Closed
Bug 952063
Opened 11 years ago
Closed 11 years ago
Trigger FxAccountsIACHelper 'onlogin', 'onloginverified' and 'onlogout' events when required
Categories
(Firefox OS Graveyard :: FxA, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
1.3 C3/1.4 S3(31jan)
People
(Reporter: ferjm, Assigned: ferjm)
References
Details
(Whiteboard: [qa?])
Attachments
(4 files, 4 obsolete files)
(deleted),
text/x-github-pull-request
|
alive
:
review+
|
Details |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
markh
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
fabrice
:
review+
|
Details | Diff | Splinter Review |
Assignee | ||
Updated•11 years ago
|
Component: Gaia → FxA
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → ferjmoreno
Updated•11 years ago
|
Whiteboard: [qa?]
Comment 1•11 years ago
|
||
Fernando, should we also think about two onlogout events here? Where's My Fox needs to know when the user controlling the device has successfully logged out with authentication:
https://bugzilla.mozilla.org/show_bug.cgi?id=952355
and of course, the user can be logged out because they failed authentication or because of some other error state.
Flags: needinfo?(ferjmoreno)
Assignee | ||
Comment 2•11 years ago
|
||
This bug is supposed to trigger events only for FxA manager apps (FTU and Settings so far), not for RPs.
WMF is a RP and so we will need a different mechanism to notify about onlogout events as described in bug 952355.
We talked about this during Madrid work week, but AFAICT we didn't decide how to notify RPs about FxA logouts. We mentioned different alternatives, like removing the authentication cookie or the possibility of using system messages. We'll need to work on this, but probably not in this bug.
Flags: needinfo?(ferjmoreno)
Assignee | ||
Updated•11 years ago
|
Summary: Trigger FxAccountsIACHelper 'onlogin' and 'onverified' events when required → Trigger FxAccountsIACHelper 'onlogin', 'onloginverified' and 'onlogout' events when required
Assignee | ||
Comment 3•11 years ago
|
||
Assignee | ||
Comment 4•11 years ago
|
||
Assignee | ||
Comment 5•11 years ago
|
||
Comment 6•11 years ago
|
||
:ferjm great to see the WIP code. Some questions about it:
* how should settings app code listen for changes?
* what will the format of the data packet be? will you just send down the event name, or will you send down data with it?
* what will be the event names?
For an example of some client code, take a look at the event listener (lines 21-22) and the event handler (lines 27-48) here:
https://github.com/6a68/gaia/blob/641c913/apps/settings/js/fxa_menu.js
Thanks!
Flags: needinfo?(ferjmoreno)
Assignee | ||
Comment 7•11 years ago
|
||
(In reply to jhirsch from comment #6)
> :ferjm great to see the WIP code. Some questions about it:
>
> * how should settings app code listen for changes?
Via FxAccountsIACHelper.addEventListener(eventName, listener)
> * what will the format of the data packet be? will you just send down the
> event name, or will you send down data with it?
There won't be any data passed to the event handlers.
> * what will be the event names?
>
onlogin, onverifiedlogin and onlogout.
Flags: needinfo?(ferjmoreno)
Assignee | ||
Comment 8•11 years ago
|
||
Attachment #8360528 -
Attachment is obsolete: true
Assignee | ||
Comment 9•11 years ago
|
||
This PR enables users of the FxAccountsIACHelper to subscribe/unsubscribe to events like 'onlogin', 'onverified' and 'onlogout' coming from the FxA platform implementation.
Attachment #8361696 -
Flags: review?(alive)
Assignee | ||
Comment 10•11 years ago
|
||
I am also adding the diff, so you can use github or bugzilla for the review.
Attachment #8361112 -
Attachment is obsolete: true
Assignee | ||
Comment 11•11 years ago
|
||
Mark, this patch does a s/fxaccounts:onlogin/fxaccounts:onverified for the notification that is triggered when the verification status changes from false to true and introduces a new fxaccounts:onlogin notification that is sent right after setting the signed in user even if it is an unverified account.
Attachment #8359917 -
Attachment is obsolete: true
Attachment #8361701 -
Flags: review?(mhammond)
Assignee | ||
Comment 12•11 years ago
|
||
Fabrice, this patch introduces the observers for the fxa notifications in the B2G fxa management service and does a s/mozFxAccountsRPChromeEvent/mozFxAccountsUnsolChromeEvent/g where "RP" used to mean Relying Party and "Unsol" stands for "unsolicited".
Attachment #8359918 -
Attachment is obsolete: true
Attachment #8361703 -
Flags: review?(fabrice)
Comment 13•11 years ago
|
||
Comment on attachment 8361701 [details] [diff] [review]
Part 1: Add onverified/onlogin (WIP)
Review of attachment 8361701 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM - I added the same notification in bug 956605, but this is a better place to fire it than I had in that bug. It's also going to make a couple other of my patches stale, but I can live with that.
Attachment #8361701 -
Flags: review?(mhammond) → review+
Comment 14•11 years ago
|
||
ferjm - It just occurred to me that it might not be possible to tell, from the settings app, whether the user is logged out, or whether there is just no information locally. Is that right? getAccounts() would return `null` in either case?
It might be worthwhile to differentiate the two states, to avoid showing users a logged-out state when they're already logged into the server, but the cache is cold. I'll know more after talking with UX next week about cold-cache edge cases.
Flags: needinfo?(ferjmoreno)
Comment 15•11 years ago
|
||
Comment on attachment 8361696 [details]
Part 3: Gaia PR
r+ but please see github comments.
Attachment #8361696 -
Flags: review?(alive) → review+
Assignee | ||
Comment 16•11 years ago
|
||
Thanks Mark and Alive for the review!
(In reply to jhirsch from comment #14)
> ferjm - It just occurred to me that it might not be possible to tell, from
> the settings app, whether the user is logged out, or whether there is just
> no information locally. Is that right? getAccounts() would return `null` in
> either case?
>
> It might be worthwhile to differentiate the two states, to avoid showing
> users a logged-out state when they're already logged into the server, but
> the cache is cold. I'll know more after talking with UX next week about
> cold-cache edge cases.
IMHO the concept of "logged-out account" does not make sense until we consider multi-account support.
The platform does not save any information about previously logged accounts. When a logout is requested, we remove the server session and the local account information.
Flags: needinfo?(ferjmoreno)
Assignee | ||
Comment 17•11 years ago
|
||
Try build looks good: https://tbpl.mozilla.org/?tree=Try&rev=9776f6ede91d
Updated•11 years ago
|
Attachment #8361703 -
Flags: review?(fabrice) → review+
Assignee | ||
Comment 18•11 years ago
|
||
Comment 19•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/dea1e5ca965d
https://hg.mozilla.org/mozilla-central/rev/27083f8936a7
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → 1.3 C3/1.4 S3(31jan)
You need to log in
before you can comment on or make changes to this bug.
Description
•