Refactor session/account status handling
Categories
(Firefox :: Firefox Accounts, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox72 | --- | fixed |
People
(Reporter: markh, Assigned: markh)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
We have strangeness around the "public" function hasLocalSession()
and sessionStatus()
. In particular, we want to end up in a place where:
-
sessionStatus()
is no longer a public function - the fact external callers might want this means our API is wrong. For example, if we see a 401 fetching an oauth token or (say) signing an assertion/certificate/whatever, then we should probably check the session status at that time. -
FxAccountsPush.jsm calls
sessionStatus()
, then drops some credentials and notifies observers of the account state change. This should be done whenever we notice the session is invalid, not just when push gets a password change notice. -
hasLocalSession()
probably can remain as a public function, but with a new name - it's the canonical "are we in a 'needs reauth' state?" function.
Assignee | ||
Comment 1•6 years ago
|
||
heh - we also have accountStatus()
, which is "does the account still exist". This too should be removed from the public API - we are doing something wrong if we are exposing an API which says a user is logged in to an account which doesn't exist!
Updated•6 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
I'm about to put a patch up for this change. I'll be asking :mtigley for review because this touches the FxA code in AboutProtectionsHandler.jsm.
Note that I intend landing this in 72, so there's no urgency for the review.
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D49525
Comment 5•5 years ago
|
||
bugherder |
Description
•