currently update_info() - in act-user.c - is async. this behavior breaks the following user case: call add_new_user_for_object_path() which in turn calls _act_user_update_from_object_path() which in turn calls update_info() if this runs async, the user object is returned from add_new_user_for_object_path() almost empty, with only the property 'object_path' filled. so, the caller is receiving an object user that's invalid in practice: (gdb) p *user $5 = {parent = {g_type_instance = {g_class = 0x12afb50}, ref_count = 2, qdata = 0x0}, connection = 0xf55e60, accounts_proxy = 0x18290b0, object_proxy = 0x18001c0, get_all_call = 0x0, object_path = 0x1811810 "/org/freedesktop/Accounts/User1003", uid = 0, user_name = 0x0, real_name = 0x0, password_hint = 0x0, home_dir = 0x0, shell = 0x0, email = 0x0, location = 0x0, icon_file = 0x0, language = 0x0, x_session = 0x0, our_sessions = 0x0, other_sessions = 0x0, login_frequency = 0, login_time = 0, login_history = 0x0, account_type = ACT_USER_ACCOUNT_TYPE_STANDARD, password_mode = ACT_USER_PASSWORD_MODE_REGULAR, uid_set = 0, is_loaded = 0, locked = 0, automatic_login = 0, system_account = 0, local_account = 1, nonexistent = 0} there's a bug visible in gnome-control-center that's triggered by this behavior: after cretaing a user, it's not being selected by default. you have to click on the newly-created user so select it. this is why we are receiving this wrong 'User' object.
Created attachment 83207 [details] [review] proposed patch
is control-center connecting to notify::loaded before trying to use the user object?
(In reply to comment #2) > is control-center connecting to notify::loaded before trying to use the user > object? nope. this the right thing to do, isn't it?
yea, exactly. The api is a little non-standard and could use a revamp to modern constructs, but basically when you get a user it may not be loaded yet, so you watch for the property to toggle over before calling methods on the user object.
thanks. I've patched control-center: https://bugzilla.gnome.org/show_bug.cgi?id=704426
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.