Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Multiple FxAccountsManager instances #3058

Closed
eoger opened this issue Apr 29, 2020 · 4 comments
Closed

[iOS] Multiple FxAccountsManager instances #3058

eoger opened this issue Apr 29, 2020 · 4 comments

Comments

@eoger
Copy link
Contributor

eoger commented Apr 29, 2020

Did some digging with @garvankeeley on a bug today and we figured out that we were playing with two FxAccountsManager instances with different states, because NotificationService (small binary spawned by incoming push notifications) and Fennec (the actual app) are two different executables with no shared memory.

I see this as a big footgun for the future that's going to cause pretty bad bugs that are going to take a long time to debug.

┆Issue is synchronized with this Jira Task
┆Epic: FxA Ecosystem (backlog)

@eoger
Copy link
Contributor Author

eoger commented Apr 29, 2020

The way we resolved this currently, is to re-create an instance of FxAccountsManager in NotificationService every time a push message is received, so we're working with a "fresh" state for the manager, however I suspect making state changes on the NotificationService side will end up not being reflected on the app side

@garvankeeley
Copy link
Contributor

(x-ref to PR related to quickly addressing the fresh state in the service mozilla-mobile/firefox-ios#6496)

@rfk
Copy link
Contributor

rfk commented Apr 29, 2020

In the past we've talked about moving the storage for FxA state into rust code itself, so that instead of calling code having to persist a JSON string after modifying account state, we have the rust code make calls to a persistence layer as required. Would that help keep things straight here, if the two processes were operating on the same underlying state?

@eoger
Copy link
Contributor Author

eoger commented Apr 30, 2020

I suspect it would help, but wouldn't solve the problem: each FxAccountManager holds a RustFxAccounts instance. So anything cached in memory would not be synchronized. There's also the bigger problem that FxAccountManager itself holds state (well, mostly the state machine state).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants