Repository navigation
feat(xmtp_db): add IntentState::Superseded for abandoned guarded intents - #4019
Conversation
|
Claude finished @tylerhawkes's task —— View job PR Review - August 19, 2026 19:35 UTCOverviewThis PR adds Code Quality & DesignPositive:
Critical Issue (already flagged by Macroscope): Fix needed: // Line 524 should add:
.filter(dsl::state.eq(IntentState::ToPublish))Test Coverage ConcernsMissing tests (0% patch coverage per codecov):
Recommendation: Add a test similar to
Minor Observations
Security & PerformanceNo security concerns identified. Performance impact is negligible (one additional enum variant). Summary: The implementation is clean but requires the state guard fix and test coverage before merging. The core design decision (separate Superseded state) is sound. |
ApprovabilityVerdict: Would Approve Macroscope's review found this PR approvable — Adds a new terminal Not approved because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
71e7d3c to
d852894
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4019 +/- ##
==========================================
- Coverage 85.93% 85.90% -0.03%
==========================================
Files 417 417
Lines 68170 68188 +18
==========================================
- Hits 58579 58577 -2
- Misses 9591 9611 +20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
d852894 to
43d1402
Compare
Stack
Merge bottom-up — each PR is based on its parent below.
Android is the priority path: #4019 → #4011 → #4012 → #4016.
IntentState::Superseded(base:main) ← this PRAlready merged: #4018 (proto regen). Related follow-up, independent of this stack: #4020.
Adds
IntentState::Superseded, a terminal state for an intent abandoned before publishing because its compare-and-swap guard no longer matched the committed value.Why a new state rather than reusing
Errorsync_until_intent_resolvedmapsIntentState::Errorto a genericGroupError::Sync. A caller cannot tell "another member changed the field first, re-derive and retry" from "the network is down" — and those want opposite reactions. Immediately republishing is right for the first and wrong for the second.Processedis equally unusable: it reads as success, so the caller would be told a write landed that never did.So the state has to be distinct.
Supersededis terminal, carries no error semantics, andupdate_app_datatranslates it into a typedAppDataSupersedederror in the next PR.Compatibility
New variant, value
6. The column is a plain integer and nothing migrates, but note this is one-way for local databases: a client old enough not to know the variant fails to deserialize an intent row written asSuperseded. That is the same constraint every priorIntentStateaddition carried.🤖 Generated with Claude Code
https://claude.ai/code/session_01AdY7WKkNbJmdzpmUWvW1my
Note
Add
IntentState::Supersededfor intents abandoned due to CAS guard mismatchIntentState::Superseded(value6) to represent group intents abandoned when a compare-and-swap guard fails during publish.set_group_intent_supersededtoQueryGroupIntent, which transitions an intent toSupersededonly fromToPublishstate; returnsNotFound::IntentForToPublishotherwise.FromSqldeserialization to map integer6toSupersededinstead of erroring.mls_sync, aSupersededoutcome fromprocess_own_messagenow logs an error and takes no further action.Macroscope summarized 43d1402.