Check values have changed before setting the model
ClosedPublic

Authored by meven on Nov 19 2019, 11:55 AM.

Details

Summary

Only save data that needs to be saved and use sanitized data rather than raw text field input.

BUG: 384894
FIXED-IN: 5.18

Test Plan

Edit Username -> have a PolicyKit password verification
Edit Avatar -> no more password verification popup

Diff Detail

Repository
R128 User Manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
meven created this revision.Nov 19 2019, 11:55 AM
Restricted Application added a project: Plasma. · View Herald TranscriptNov 19 2019, 11:55 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
meven requested review of this revision.Nov 19 2019, 11:55 AM
apol added a subscriber: apol.Nov 19 2019, 12:42 PM

The commit message looks wrong, maybe you meant PolicyKit? PackageKit should be irrelevant.

Other than that +1

meven edited the test plan for this revision. (Show Details)Nov 19 2019, 2:06 PM
In D25398#564639, @apol wrote:

The commit message looks wrong, maybe you meant PolicyKit? PackageKit should be irrelevant.

Thank you for pointing it out.

Other than that +1

Do you mean to accept it then ?

meven edited the summary of this revision. (Show Details)Nov 19 2019, 7:18 PM
meven added a comment.EditedNov 19 2019, 7:31 PM

Nice. Does this fix any of these?

This diff fix this one

I had a look at the others :

Something I noticed when having an avatar and setting any other parameter.
Apparently AccountService removes the icon as it considered it transient cache data :
https://github.com/magcius/accountsservice/blob/eb166ec7592704a897594f7ca4c47b70d871a85c/src/daemon.c#L1105

I had a look at the others :

Something I noticed when having an avatar and setting any other parameter.
Apparently AccountService removes the icon as it considered it transient cache data :
https://github.com/magcius/accountsservice/blob/eb166ec7592704a897594f7ca4c47b70d871a85c/src/daemon.c#L1105

So it's an upstream issue? Is that really where upstream AccountsService lives? Some random guy's GitHub?

meven added a comment.Nov 20 2019, 6:56 AM

I had a look at the others :

Something I noticed when having an avatar and setting any other parameter.
Apparently AccountService removes the icon as it considered it transient cache data :
https://github.com/magcius/accountsservice/blob/eb166ec7592704a897594f7ca4c47b70d871a85c/src/daemon.c#L1105

So it's an upstream issue? Is that really where upstream AccountsService lives? Some random guy's GitHub?

This was a clone of an old version.

Current behavior is the same in the current version.
https://cgit.freedesktop.org/accountsservice/tree/src/daemon.c#n155
Apparently the accountservice daemon wants to uncache the user and in doing so delete data without updating its internal reference.

GNOME does the same as our user-manager but I guess it is not affected.
https://github.com/GNOME/gnome-control-center/blob/f5f67823db5a629fa3ce618bc1d8b80d14f1fc59/panels/user-accounts/cc-avatar-chooser.c#L87

I did some digging but could not pinpoint the problem origin.

In the meantime, I believe this diff is worth merging and might be useful for stable branch even.

Agreed. Works for me and looks safe, but maybe let's do master only for safety.

Can you file a bug upstream on the odd behavior in AccountsService?

ngraham accepted this revision.Nov 20 2019, 3:01 PM
This revision is now accepted and ready to land.Nov 20 2019, 3:01 PM
davidedmundson accepted this revision.Nov 21 2019, 2:26 PM
This revision was automatically updated to reflect the committed changes.
meven added a comment.Nov 21 2019, 3:11 PM

Agreed. Works for me and looks safe, but maybe let's do master only for safety.

Can you file a bug upstream on the odd behavior in AccountsService?

No need in the end. I found the bug origin in our code : D25439