fix(profile-sync-controller): deduplicate identical pairing calls#8984
Open
mathieuartu wants to merge 2 commits into
Open
fix(profile-sync-controller): deduplicate identical pairing calls#8984mathieuartu wants to merge 2 commits into
mathieuartu wants to merge 2 commits into
Conversation
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
References
Related to: https://consensyssoftware.atlassian.net/browse/MUL-1865
Checklist
Note
Low Risk
Localized deduplication around an existing pairing API call; failures are uncached and successful cache is short-lived, so pairing semantics and retries stay the same aside from fewer duplicate requests.
Overview
SRPJwtBearerAuth.pairSrpProfilesno longer issues a separatePOST /api/v2/profile/pairfor every overlapping trigger. It builds an order-insensitive cache key from the access-token set, coalesces concurrent callers on one in-flight promise, and reuses a successful result for 30 seconds so rapid sequential retries (unlock, multiple UI surfaces,performSignIn) collapse to a single request.Failed pair attempts are not cached, so the existing
needsProfilePairingretry path can still hit the API on the next try. Tests and the package changelog document the behavior.Reviewed by Cursor Bugbot for commit 3a34409. Bugbot is set up for automated code reviews on this repo. Configure here.