Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

React to WebChannel extension events to notify the SyncManager #3817

Closed
Amejia481 opened this issue Jul 18, 2019 · 4 comments
Closed

React to WebChannel extension events to notify the SyncManager #3817

Amejia481 opened this issue Jul 18, 2019 · 4 comments
Labels
🌟 feature New functionality and improvements <sync> Component: sync-logins
Milestone

Comments

@Amejia481
Copy link
Contributor

Amejia481 commented Jul 18, 2019

When the user select what to sync the Web-channel extension will be notified and we need to forward these event to the SyncManager.

┆Issue is synchronized with this Jira Task

@Amejia481 Amejia481 added 🌟 feature New functionality and improvements <sync> Component: sync-logins labels Jul 18, 2019
@grigoryk
Copy link
Contributor

General shape of the messages we'll receive from the WebExtension is described in #3826 (ticket that tracks the WE work itself). Expect to have at least "signIn", "signUp", "password changed" events.

@grigoryk
Copy link
Contributor

Some FxaAccountManager public API changes that we'll need to make here:

  • we will now receive a list of enabled engines during sign-ups. One way to model that is by adding an optional enginesToSync parameter to finishAuthenticationAsync
  • "your password changed"/"account updated" public api method, that should change internal state of the FirefoxAccount object so that we continue to be able to issue valid access tokens. Additionally, it should repopulate SyncAuthInfo cache.
    • i'm assuming here that we'll get enough information from the WebExtension. In a similar situation, Fennec receives [email, uid, verified, unwrapKB, sessionToken, keyFetchToken].

Additionally, consider if we can replace request interceptor logic entirely. This could be done at the feature level.

@rfk
Copy link
Contributor

rfk commented Jul 19, 2019

FWIW, I have some high-level advice here based on our experience implementing WebChannel message support in other browsers: trust, but validate. The web content has its own view of the world which may not match with your own, so always validate what it's asking you to do just in case it has gotten confused. For example:

  • If you receive a message listing then enabled engines, make sure you're actually in the middle of a signup flow where such a message would be expected
  • If you receive a "password changed" message, check that it's for the same account as the one you believe you're signed in as.

I think the explicit-state-machine approach used here will help make this easier.

@grigoryk
Copy link
Contributor

grigoryk commented Sep 3, 2019

WebChannel side of things done in #4221.
SyncManager integration is coming in #2727, which will cover this issue.

@grigoryk grigoryk closed this as completed Sep 3, 2019
@pocmo pocmo added this to the 🍉 12.0.0 milestone Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🌟 feature New functionality and improvements <sync> Component: sync-logins
Projects
None yet
Development

No branches or pull requests

4 participants