Repository navigation
feat: AppDataUpdateData intent serialization proto - #333
Conversation
ApprovabilityVerdict: Approved Additive proto schema change defining a new local-only serialization message. The author owns this file, and the open review comment is a clarifying question rather than a concern about the implementation. You can customize Macroscope's approvability policy. Learn more. |
| // Full prior bytes of the component as observed when the caller | ||
| // built the intent. Merge base for the 3-way merge. | ||
| bytes pre_value = 1; | ||
| // Full desired post bytes of the component. |
There was a problem hiding this comment.
Do you have some reference on how we resolve the residual mutation and do the 3-way-merge?
I like this approach in general, just want to learn more about the process since it seems important to grok moving forward.
There was a problem hiding this comment.
For components that are Maps/Sets you can just write out the current state and the desired state and when doing the commit we can figure out what the delta is to get into the desired state. So if Alix wants to add inboxes x and y, but Bo adds X in the meantime, we can still figure out that we need to add y and just make that change. I'll have to do more tests with interim removals, but the idea is that we can state the end state (either total, or the diffs) and then choose to not publish some of the changes if they've already been made.
There was a problem hiding this comment.
After thinking about it, we're going to go with last writer wins for now. We can update this later if we want some better semantics around races, but those should be rare enough that we maybe don't care about them.
Local-only serialization shape for libxmtp's group_intents table. Carries component_id + one of two op flavors: - replace: full-replace components (Bytes/String typed) - delta_with_base: collection components (TlsMap/TlsSet) — dispatcher reads current state and emits only the residual mutations from pre→post that haven't already been applied. Replay-correct under concurrent same-key writes. Never appears on the MLS wire; collapses the per-component IntentKind/IntentData proliferation into a single generic shape.
7b8260c to
de79332
Compare
Dismissing prior approval to re-evaluate de79332
|
🎉 This PR is included in version 3.91.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Adds
AppDataUpdateData+AppDataUpdateDeltaWithBasetoxmtp.mls.databasefor local-only intent serialization of libxmtp's new genericIntentKind::AppDataUpdate(xmtp/libxmtp#3664).The proto carries:
component_id: uint32(libxmtp'su16widened — proto has no u16)oneof opwith:bytes replace— full-replace components (Bytes/String typed)AppDataUpdateDeltaWithBase delta_with_base— collection components (TlsMap/TlsSet) withpre_value+post_valuefor 3-way mergeNever crosses the MLS wire; stored only in libxmtp's local SQLite
group_intentstable.Test plan
7b8260c3041389bf706fb665460adbbd520d2be7.GEN_PROTOS=true cargo check -p xmtp_proto.🤖 Generated with Claude Code
Note
Add
AppDataUpdateDataprotobuf message for app data update intent serializationAdds a new versioned protobuf message
AppDataUpdateDatain intents.proto with aV1envelope containingcomponent_id(uint32) andpayload(bytes). Inline comments document the expected payload semantics forBytes/String,TlsMap, andTlsSetcomponent types.Macroscope summarized de79332.