Skip to content

feat: AppDataUpdateData intent serialization proto - #333

Merged
tylerhawkes merged 1 commit into
mainfrom
feature/generic-appdata-intent
May 26, 2026
Merged

tylerhawkes merged 1 commit into
mainfrom
feature/generic-appdata-intent

Conversation

@tylerhawkes

@tylerhawkes tylerhawkes commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds AppDataUpdateData + AppDataUpdateDeltaWithBase to xmtp.mls.database for local-only intent serialization of libxmtp's new generic IntentKind::AppDataUpdate (xmtp/libxmtp#3664).

The proto carries:

  • component_id: uint32 (libxmtp's u16 widened — proto has no u16)
  • oneof op with:
    • bytes replace — full-replace components (Bytes/String typed)
    • AppDataUpdateDeltaWithBase delta_with_base — collection components (TlsMap/TlsSet) with pre_value+post_value for 3-way merge

Never crosses the MLS wire; stored only in libxmtp's local SQLite group_intents table.

Test plan

  • Pinned at SHA 7b8260c3041389bf706fb665460adbbd520d2be7.
  • libxmtp regen succeeds with GEN_PROTOS=true cargo check -p xmtp_proto.
  • Round-trip + edge-case tests in libxmtp PR #3664 pass.

🤖 Generated with Claude Code

Note

Add AppDataUpdateData protobuf message for app data update intent serialization

Adds a new versioned protobuf message AppDataUpdateData in intents.proto with a V1 envelope containing component_id (uint32) and payload (bytes). Inline comments document the expected payload semantics for Bytes/String, TlsMap, and TlsSet component types.

Macroscope summarized de79332.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes May 21, 2026
@macroscopeapp

macroscopeapp Bot commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Comment thread proto/mls/database/intents.proto Outdated
// 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@tylerhawkes tylerhawkes mentioned this pull request May 22, 2026
1 of 3 tasks
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.
@tylerhawkes
tylerhawkes force-pushed the feature/generic-appdata-intent branch from 7b8260c to de79332 Compare May 26, 2026 19:59
@macroscopeapp
macroscopeapp Bot dismissed their stale review May 26, 2026 20:00

Dismissing prior approval to re-evaluate de79332

@tylerhawkes
tylerhawkes enabled auto-merge (squash) May 26, 2026 20:02
@tylerhawkes
tylerhawkes merged commit 823184c into main May 26, 2026
7 checks passed
@tylerhawkes
tylerhawkes deleted the feature/generic-appdata-intent branch May 26, 2026 20:02
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.91.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants