[IPProtection] getAccessToken is getting called excessively
Categories
(Firefox for Android :: Privacy, defect)
Tracking
()
People
(Reporter: mavduevskiy, Assigned: mavduevskiy)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxdroid])
Attachments
(4 files, 1 obsolete file)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
Steps to reproduce
- Create a new account, without giving it authorization to use VPN.
- Log into that account.
- Add logs/put debugger around getToken call.
Expected behavior
we don't get getToken request for a user that can not use the feature
Actual behavior
we do get that request, and multiple times upon authentication
Device information
- Firefox version:
- Android device model:
- Android OS version:
Any additional information?
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Updated•2 months ago
|
Comment 1•2 months ago
|
||
S1 is incident-level and required an immediate unplanned dot release, hence the tracking flags automatically set for releases in flight. Downgrading to S2 as I don't think you intended to do that.
https://wiki.mozilla.org/BMO/UserGuide/BugFields#bug_severity:~:text=S1,available
| Assignee | ||
Comment 2•2 months ago
|
||
... until user action or a successful authorization.
Comment 3•2 months ago
|
||
We introduce an accessor for reading our persisted account on disk by
consuming the JSON string first. This avoids having to know which
SharedPreference type is used (secure or regular).
The accessor acts as a weak implementation wrapper to a future API that
feeds in from the native fxa_client.
We always read the state from disk for every request to ensure
freshness. This uses a background Corountine context to avoid IO on
the FxaAccountManager that does not need to be synchronized with it's
own coroutineContext: this is a read-only check and reading may fail for
a variety of reasons, we do not need to block the account manager to
avoid these failures.
Comment 4•2 months ago
|
||
To avoid DDOS-ing our servers, we check our existing scopes to see if we
can fetch an access token. If we don't have one and we are
authenticated, we try to perform a token exchange if our
account does have the global scope.
This is similar to behaviour from before, except that we only attempt
the token exchange when we enter the VPN UI screen. If the account was
not entitled, we then perform an authorization as we previously did.
Co-authored-by: Mark Hammond <mhammond@skippinet.com.au>
Comment 6•2 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/d4e6916363d2
https://hg.mozilla.org/mozilla-central/rev/a2d34562b7dd
Comment 7•2 months ago
|
||
We introduce an accessor for reading our persisted account on disk by
consuming the JSON string first. This avoids having to know which
SharedPreference type is used (secure or regular).
The accessor acts as a weak implementation wrapper to a future API that
feeds in from the native fxa_client.
We always read the state from disk for every request to ensure
freshness. This uses a background Corountine context to avoid IO on
the FxaAccountManager that does not need to be synchronized with it's
own coroutineContext: this is a read-only check and reading may fail for
a variety of reasons, we do not need to block the account manager to
avoid these failures.
Original Revision: https://phabricator.services.mozilla.com/D309749
Updated•2 months ago
|
Comment 8•2 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: The VPN feature that is launching in 153 will make excessive requests to the FxA servers without these patches.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: These patches will reduce the number of requests made to FxA as part of the VPN feature launch. The risk is low because if for some reason it doesn't do what it is intended, we are still in the same state of requests made.
- String changes made/needed?: n/a
- Is Android affected?: yes
Comment 9•2 months ago
|
||
To avoid DDOS-ing our servers, we check our existing scopes to see if we
can fetch an access token. If we don't have one and we are
authenticated, we try to perform a token exchange if our
account does have the global scope.
This is similar to behaviour from before, except that we only attempt
the token exchange when we enter the VPN UI screen. If the account was
not entitled, we then perform an authorization as we previously did.
Co-authored-by: Mark Hammond <mhammond@skippinet.com.au>
Original Revision: https://phabricator.services.mozilla.com/D309985
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Comment 10•2 months ago
|
||
| uplift | ||
Updated•2 months ago
|
Updated•2 months ago
|
Comment 11•2 months ago
|
||
Is there something that QA can verify here? Thank you!
Updated•2 months ago
|
Updated•2 months ago
|
Comment 12•2 months ago
|
||
(In reply to Raluca Ilban [:rilban], Premium Services - VPN from comment #11)
Is there something that QA can verify here? Thank you!
Thanks for checking in. No, I don't believe so. Engineering will need to monitor this dashboard to see the rejection numbers for vpn reduce to something reasonable.
Updated•2 months ago
|
Description
•