Re: Best practices for using GOA



Hey Michael,

It is exciting to see Geary get GOA integration!

On Mon, Jun 18, 2018 at 10:43:07AM +1000, Michael Gratton wrote:
The GOA docs say that when "account-removed" is fired, clients should 
not delete any data, but then when is it actually appropriate to do so? 
Geary can accumulate gigbytes of data for an account, so relying on 
manual intervention to remove an account when none was required to 
create it seems counter-intuitative. There's no "account-deleted" 
signal that I can see.

That part of the documentation was written by David Zeuthen in the
very early days of gnome-online-accounts.  The idea was to not remove
account specific caches and data from applications due to an (online)
update.

(In theory, one might want to restart goa-daemon after an update, and
that leads to GoaClient::account-removed being emitted.)

Fast forward to 2018, we don't recommend online updates anymore.  On
traditional package-based systems one is supposed to use systemd's
system-update.target, while OSTree-based systems require you to reboot
into the new image.  Either way, there's no need to restart a running
goa-daemon.

That leaves the case where you might be hacking on GOA and need to
keep restarting goa-daemon.

Maybe a more reasonable suggestion for applications would be to wait
for a certain interval of time before dropping account-specific caches
and data?  What do you think?

Secondly, when users go to add a new account to Geary and it's either a 
Google or outlook.com account, I'd like to direct them to add a GOA 
account instead so they get their contacts sync'ed as well. I was 
thinking of a UX flow something like:

 1. Collect name, email address (or just explicitly prompt to select a 
service provider)
 2. If a supported GOA provider is indicated, launch GOA CC panel to 
add that type
 3. Else keep collecting custom server details

In (2), I'd like the GOA CC panel dialog to appear, prompt for 
credentials, then disappear when setup is complete. By this time Geary 
would have added the account in the background and user can just get 
going.

Is there a way of doing this? The Manager.AddAccount() method seems to 
be aimed at backends

Yeah, Manager.AddAccount() won't let you do that.

Currently, gnome-online-accounts treats the addition and removal of
accounts as privileged operations that are only performed through
Settings, while applications can consume configured accounts using the
D-Bus interface.  It was done this way because:

(a) The accounts are global across the entire session.  Often an account
is used by multiple components.  So, the mental model is that you add or
remove an account from the OS, and not a single application.

(b) For OAuth/OAuth2 based providers, it prevents the applications from
ever being in contact with the user's raw passwords.

there doesn't seem to a command-line option I can use to do 
anything except launch the GOA CC without indicating it should add an 
account for a specific provider.

In the past, you could do:
$ gnome-control-center online-accounts add google ...

We had added it for an ad-hoc, experimental feature that was neither
designed nor finished, and never used.  Recently, it led to a
complication by triggering a WebKitGTK+, so we ended up removing it.
See: https://bugzilla.gnome.org/show_bug.cgi?id=789469

Maybe bring it up with the GNOME designers and we can revisit it?  It
would be good to have a proper plan before writing any code.

Cheers,
Rishi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]