fix(sharing): preserve inviter policy during acceptance#1345
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f904594ac1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d2fa61f to
05eae62
Compare
f904594 to
287f691
Compare
05eae62 to
de48cb5
Compare
287f691 to
20d70c6
Compare
de48cb5 to
d043ba1
Compare
20d70c6 to
12809f0
Compare
d043ba1 to
e77a38e
Compare
12809f0 to
1498df3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1498df31ca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const hasRecipientKeyBinding = | ||
| keyMatch.provenance === "recipient_invite" && expected.provenance === "recipient_invite"; | ||
| const hasConflictingFingerprint = | ||
| hasRecipientKeyBinding && keyMatch.source_fingerprint !== expected.source_fingerprint; |
There was a problem hiding this comment.
Reject unkeyed inviter rows for recipient bindings
When the existing row was first projected by a direct-share acceptance as an inviter device (provenance = 'exact_project_invite'), its source_fingerprint is based only on identity/device and does not include the device public key. A later recipient/team/add-device onboarding for the same identity and device but a different devicePublicKey reaches this branch with expected.provenance = 'recipient_invite'; because hasRecipientKeyBinding is false, the code returns success without checking or storing the key fingerprint. Fresh evidence in this version is that commitDirectProjectSharePolicyInTransaction now creates those exact_project_invite device rows, so a projected inviter device can bypass the key-binding conflict path.
Useful? React with 👍 / 👎.
Merge activity
|
1498df3 to
587ad58
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 587ad5885a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| deviceId, | ||
| displayName: inviterDeviceDisplayName(db, deviceId), | ||
| })); | ||
| commitDirectProjectSharePolicyInTransaction(db, { |
There was a problem hiding this comment.
Classify policy-commit conflicts as terminal
When automatic maintenance advances a waiting share whose coordinator payload has been accepted, this new in-transaction policy commit can throw local conflicts such as device_binding_conflict, intent_conflict, or inviter_identity_conflict. Those errors are not in TERMINAL_RECONCILIATION_ERRORS, so after the transaction rolls back the operation is still waiting_for_acceptance and advancePendingProjectShares records a retry with operation_read_failed instead of moving the invite to needs_attention; conflicting accepted invites will keep retrying every cooldown rather than surfacing the actionable local-policy conflict. Please classify or map these new terminal errors before they escape reconciliation.
Useful? React with 👍 / 👎.
587ad58 to
40c8009
Compare

Description
Fixes the direct-Project acceptance and recipient-authority interaction discovered by the expanded project-sharing E2E.
Type of Change
Testing
pnpm run tsc,pnpm run lint,pnpm run test)Validation:
pnpm run checkon the completed stack: 3,019 passed, 3 todoChecklist
pnpm run lintpasses for touched files)