Bug 103055

Summary: library should provide methods with error handling
Product: accountsservice Reporter: Jan Tojnar <jtojnar>
Component: generalAssignee: Matthias Clasen <mclasen>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium CC: marius.vollmer, rstrode, stefw
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Jan Tojnar 2017-10-01 14:20:21 UTC
Currently when the dbus call fails, the library consumers have no way to handle the error. This makes the library rather useless for any application that wants to provide a decent level of user experience, i.e. not swallowing errors.
Comment 1 Jan Tojnar 2017-10-01 14:24:06 UTC
Needed by: https://bugzilla.gnome.org/show_bug.cgi?id=788396
Comment 2 Robert Ancell 2017-12-19 20:39:43 UTC
Which API calls have this problem?
Comment 3 Jan Tojnar 2017-12-19 21:14:11 UTC
(In reply to Robert Ancell from comment #2)
> Which API calls have this problem?

Each of the following methods on interface `org.freedesktop.Accounts.User` can fail with either `org.freedesktop.Accounts.Error.PermissionDenied` or `org.freedesktop.Accounts.Error.Failed`.

- `SetUserName`
- `SetRealName`
- `SetEmail`
- `SetLanguage`
- `SetXSession`
- `SetLocation`
- `SetHomeDirectory`
- `SetShell`
- `SetIconFile`
- `SetLocked`
- `SetAccountType`
- `SetPasswordMode`
- `SetPassword`
- `SetPasswordHint`
- `SetAutomaticLogin`

However, the libaccountsservice functions for those do methods intentionally discard the errors – just grep for “Note this function is synchronous and ignores errors.”

- act_user_get_login_history
- act_user_set_email
- act_user_set_language
- act_user_set_x_session
- act_user_set_location
- act_user_set_user_name
- act_user_set_real_name
- act_user_set_icon_file
- act_user_set_account_type
- act_user_set_password
- act_uset_set_password_hint // there is a typo in the doc comment btw
- act_user_set_password_mode
- act_user_set_locked
- act_user_set_automatic_login
Comment 4 Ray Strode [halfline] 2017-12-19 22:09:36 UTC
honestly, at this point rather than improve the library api, i'd like to deprecate it, and encourage gdbuscodegen instead.  we should probably improve the daemon implementation to export objectmanager interface too
Comment 5 Jan Tojnar 2018-05-24 12:50:45 UTC
(In reply to Ray Strode [halfline] from comment #4)
> honestly, at this point rather than improve the library api, i'd like to
> deprecate it, and encourage gdbuscodegen instead.

Is there an issue for that?
Comment 6 GitLab Migration User 2018-08-07 09:30:14 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/accountsservice/accountsservice/issues/7.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.