Sync v2: Remove direct integration with set_if_absent#9012
Merged
CDRussell merged 2 commits intoJun 26, 2026
Merged
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
b70ae25 to
63e932f
Compare
c69e02b to
717a48c
Compare
1 task
63e932f to
15b9f51
Compare
717a48c to
e0ac7f9
Compare
15b9f51 to
00e6b25
Compare
e0ac7f9 to
ab87bae
Compare
20 tasks
ab87bae to
9adc18b
Compare
00e6b25 to
db6a0bf
Compare
CDRussell
commented
Jun 26, 2026
| if (isConcurrentMod && attempt < MAX_CONCURRENT_MODIFICATION_RETRIES) { | ||
| attempt++ | ||
| logcat { "Sync-ScopedToken: 3party credential POST hit concurrent_modification; retry $attempt/$MAX_CONCURRENT_MODIFICATION_RETRIES" } | ||
| runCatching { Thread.sleep(CONCURRENT_MODIFICATION_RETRY_DELAY_MILLIS * attempt) } |
Member
Author
There was a problem hiding this comment.
will switch to coroutine / delay in higher branch
9adc18b to
b0288d5
Compare
Collaborator
|
Looks good but retry on "concurrent_modification" and “stop after max retries” branches could use some testing |
CrisBarreiro
approved these changes
Jun 26, 2026
Member
Author
Merge activity
|
b0288d5 to
daef8d3
Compare
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.

Task/Issue URL: https://app.asana.com/1/137249556945/project/1203822806345703/task/1216036247181808?focus=true
Tech Design URL (if applicable):
Description
Drop the direct
POST /sync/keys/.../set-if-absentcall from the 3party credential creation flow which previously existed as its own distinct step. Removing this also means we can remove some now-redundant dev tooling for it.Steps to test this PR
Note
Medium Risk
Changes the sync v2 crypto path for first-time
ai_chatskeys and 3party credential setup; mistakes could break scoped login or key consistency, though behavior is localized to the 3party credential flow behind the v2 feature flag.Overview
3party credential creation no longer calls
POST /sync/keys/.../set-if-absentor usesProtectedKeyManager. When the account has no ddg-wrappedai_chatskey, the client mints an RSA keypair viamintDdgWrappedProtectedKeyand includes both ddg and 3partyProtectedKeyEntryrows (samekid) in thePOST /access-credentials/3partykeys[]payload, alongside re-wrapped existing ddg keys.The
setProtectedKeyIfAbsentRetrofit/API surface,SyncAccountRepository.createProtectedKey,ProtectedKeyManager, and related tests/dev UI (“Create Protected Key”) are removed.ThirdPartyCredentialManageradds bounded retries onconcurrent_modification409s for that credential POST and broadens 409 handling messaging before the adopt-existing-credential path.Reviewed by Cursor Bugbot for commit b0288d5. Configure here.