feat(mls/database): add expected_field_value to UpdateMetadataData.V1 - #343
Merged
Conversation
insipx
approved these changes
Aug 19, 2026
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Additive, backwards-compatible protobuf schema change - adding one optional field to an existing message. The author owns this file per CODEOWNERS, and the change is well-documented with clear intent. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
🎉 This PR is included in version 3.96.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
tylerhawkes
added a commit
to xmtp/libxmtp
that referenced
this pull request
Aug 19, 2026
…4018) Regenerates the Rust protos to pick up [xmtp/proto#343](xmtp/proto#343), which adds `expected_field_value` to `UpdateMetadataData.V1` — the compare-and-swap guard the metadata-update intent needs. `UpdateMetadataData` lives in the `xmtp.mls.database` package: it is the payload libxmtp stores for a queued intent, never sent on the wire. Nothing about the MLS commit format changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
Adds a compare-and-swap guard to the local metadata-update intent payload.
Why
UpdateMetadataData.V1is the payload libxmtp stores for a queued metadata-update intent. It carries an absolutefield_valuefrozen at queue time. When a client's published intent loses an epoch race, libxmtp rebuilds the commit from that same frozen payload and republishes it on the new epoch — so a concurrent change from another member is applied, observed, and then silently overwritten by the stale local value.That is fine for last-writer-wins fields. It is not fine for
app_data, where clients hold structured state they reconcile themselves: the overwrite discards another member's write with no signal to either side.expected_field_valuelets the publisher express "set this field to X, but only if it is still Y". libxmtp abandons the intent instead of republishing when the guard does not match, and surfaces that to the caller so it can re-merge against the value that actually landed.Compatibility
buf breakingagainstmainpasses.xmtp.mls.databasepackage: it is local intent storage, never sent on the wire. Nothing about the MLS commit format changes.🤖 Generated with Claude Code
https://claude.ai/code/session_01AdY7WKkNbJmdzpmUWvW1my
Note
Add
expected_field_valuefield toUpdateMetadataData.V1proto messageAdds an optional string field
expected_field_value(tag 3) to theUpdateMetadataData.V1message in intents.proto. The field acts as a compare-and-swap guard, allowing callers to conditionally update metadata only when the current field value matches the expected value. The field is backward compatible and is omitted from the wire when not set.Macroscope summarized 625e8c1.