-
Notifications
You must be signed in to change notification settings - Fork 329
Bug 1856729 - Switch to new app-services FxaClient #3918
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Lots of code changes here, but hopefully the comments make some sense. Here's the corresponding app-services PR. I set up a branch build in that PR, if it works you should be able to get an APK for testing from the One thing that I tried to do was improve the manual testing situation. Now if you run Here's the log results from my manual testing. The first one is just the login process, the next ones are what happened when I pushed those debug buttons. Note: I don't recommend sharing these log files in general, since they could contain auth tokens. I only shared them because I was using a fake account. To me it looks like the client is doing the right thing in those logs:
|
cc @MatthewTighe as this might effect the SyncStore work. |
🚧 Commit message is using the wrong format: _Switch to new app-services FxaClient Use the new functionality from app-services to replace code in General:
FirefoxAccount:
FxaDeviceConstellation:
FxaAccountManager:
Tests:
The comment message should look like:
|
I made some updates to the app-services side of things based on review of that PR. The main change is that That required some changes to the android-components code, but nothing too big. It brings things closer to the old system, which seems good. |
I've been thinking on how to best land this and about the risk in general. Maybe we could try to mitigate the risk by a) adding metrics and b) introducing the changes in steps. I think the process could go something like this:
Zooming out a bit, I think the risk falls into 2 categories:
|
This pull request has conflicts when rebasing. Could you fix it @bendk? 🙏 |
@MatthewTighe |
@mavduevskiy Just wanted to make sure we weren't leaving anyone hanging 🙂 I'm happy to get out of the way on this one, but please don't hesitate to reach out if I can help! |
Folks, if anyone wants to pair on this review, happy to pair on it. 🙂 |
I think we're going to be going forward with tracking these metrics. I just opened a data review issue and a PR to implement them in app-services. I really appreciate the effort here, sorry to drop such a large patch on you all. If it would help, I could definitely jump on a call and talk through some of the changes. |
Use the new functionality from app-services to replace code in service-firefox-accounts General: - Updated code to use FxaConfig class rather than Config. Config wrapped FxaConfig, but provided little value. - Updated `handleFxaExceptions` and removed all other Utils functions - Use FxaClient's CoroutineContext to run all fxa-related jobs. - Many FxaClient methods no longer directly return a result, but instead input an optional `CompletableDeferred<T>` that they complete when the operation is finish. See the app-services PR for details. FirefoxAccount: - Don't wrap FxaClient calls in withContext, this is handled in app-services now. - Updated FirefoxAccount docs to describe its relationship to OAuthAccount. - Make AccountStorage return a FirefoxAccount directly instead of an OAuthAccount FxaDeviceConstellation: - Let FxaClient handle auth errors when sending device commands - Updating FxaDeviceSettingsCache is now handled in the FxaAccountManager.onFxaEvent method FxaAccountManager: - Replaced state machine code with the new `queueAction()` + `onFxaEvent` functions instead. Tests: - Removed a good deal of tests, the app-services tests should replace these. - There were several tests that dealt with state persistence plus oauth. I think these should be convered by the regular state change tests, were they testing something else? - Auth recovery is handled by several tests starting with `FxaActionProcessor calls checkAuthorizationStatus after auth errors` - The main tests I tried to keep were the ones focused on observer notification and other integrations with the larger code base. We're mostly just forwarding the events that FxaClient sends us to handle this.
I'm really liking the idea of using an RFC to agree on the big picture, and splitting the commits into smaller pieces. I wrote up an initial draft here: https://docs.google.com/document/d/16UUdfx1yvK4W-jBvczL5tPUaJ-R-TFIRiLckAS7BJmM/edit Please take a look when you can, any feedback is appreciated. No rush though, we should wait for Tarik to get back next week before taking any action. |
I think everyone agrees with the slower, step-by-step, approach. Let's close this one and start with a much smaller one: #4228. |
Use the new functionality from app-services to replace code in service-firefox-accounts
General:
handleFxaExceptions
and removed all other Utils functionsCompletableDeferred<T>
that they complete when the operation is finish. See the app-services PR for details.FirefoxAccount:
FxaDeviceConstellation:
FxaAccountManager:
queueAction()
+onFxaEvent
functions instead.Tests:
Removed a good deal of tests, the app-services tests should replace these.
There were several tests that dealt with state persistence plus oauth. I think these should be convered by the regular state change tests, were they testing something else?
Auth recovery is handled by several tests starting with
FxaActionProcessor calls checkAuthorizationStatus after auth errors
The main tests I tried to keep were the ones focused on observer notification and other integrations with the larger code base. We're mostly just forwarding the events that FxaClient sends us to handle this.
Pull Request checklist
After merge
To download an APK when reviewing a PR (after all CI tasks finished running):
Checks
at the top of the PR page.firefoxci-taskcluster
group on the left to expand all tasks.build-apk-{fenix,focus,klar}-debug
task you're interested in.View task in Taskcluster
in the newDETAILS
section.GitHub Automation
https://bugzilla.mozilla.org/show_bug.cgi?id=1856729