Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ mod tests {
version: Some(GroupMembershipEntryVersion::V1(GroupMembershipEntryV1 {
sequence_id: seq,
failed_installations: failed,
admitted_via_external_group_id: vec![],
})),
}
}
Expand Down
3 changes: 3 additions & 0 deletions crates/xmtp_mls/src/groups/app_data/component_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2375,6 +2375,7 @@ mod tests {
version: Some(Version::V1(GroupMembershipEntryV1 {
sequence_id: 1,
failed_installations: vec![],
admitted_via_external_group_id: vec![],
})),
},
);
Expand All @@ -2399,6 +2400,7 @@ mod tests {
version: Some(Version::V1(GroupMembershipEntryV1 {
sequence_id: 7,
failed_installations: vec![vec![0xA1; 16]],
admitted_via_external_group_id: vec![],
})),
},
);
Expand All @@ -2408,6 +2410,7 @@ mod tests {
version: Some(Version::V1(GroupMembershipEntryV1 {
sequence_id: 42,
failed_installations: vec![vec![0xB1; 16]],
admitted_via_external_group_id: vec![],
})),
},
);
Expand Down
4 changes: 4 additions & 0 deletions crates/xmtp_mls/src/groups/app_data/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ async fn build_partitioned_group_membership<C: XmtpSharedContext>(
version: Some(GroupMembershipEntryVersion::V1(GroupMembershipEntryV1 {
sequence_id: *seq,
failed_installations: failed,
// Every pre-migration member was added via Welcome /
// legacy flows, never an external commit, so the
// admitted-via tag is correctly absent for all of them.
admitted_via_external_group_id: vec![],
})),
},
);
Expand Down
5 changes: 5 additions & 0 deletions crates/xmtp_mls/src/groups/intents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,10 @@ impl From<AppDataUpdateIntentData> for Vec<u8> {
version: Some(AppDataUpdateVersion::V1(AppDataUpdateDataV1 {
component_id: intent.component_id as u32,
payload: intent.payload,
// Multi-component atomic writes (XIP-82 enable atomicity)
// populate this in the external-commit stack; the generic
// single-component intent carries none.
additional_updates: vec![],
})),
}
.encode_to_vec()
Expand Down Expand Up @@ -1170,6 +1174,7 @@ mod app_data_update_intent_tests {
version: Some(AppDataUpdateVersion::V1(AppDataUpdateDataV1 {
component_id: u16::MAX as u32 + 1,
payload: vec![],
additional_updates: vec![],
})),
}
.encode_to_vec();
Expand Down
10 changes: 10 additions & 0 deletions crates/xmtp_mls/src/groups/mls_sync/update_group_membership.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,22 @@ pub(crate) fn build_group_membership_app_data_payload(

/// Encode a per-inbox `GroupMembershipEntry::V1` value with the given
/// `sequence_id` and an empty `failed_installations` list.
///
/// `admitted_via_external_group_id` is left absent here. That is only
/// correct while nothing can set it: the field is written exclusively by
/// the external-commit join path (XIP-82), which does not exist yet on
/// this branch. The Update arm of [`build_group_membership_app_data_payload`]
/// rewrites entries from scratch, so once joins can tag entries it MUST
/// carry the existing tag through (the tag is write-once and validators
/// will reject a member commit that clears it); that preservation lands
/// together with the validator enforcement in the external-commit stack.
fn encode_membership_entry(sequence_id: u64) -> Result<Vec<u8>, GroupError> {
let entry = GroupMembershipEntry {
version: Some(group_membership_entry::Version::V1(
group_membership_entry::V1 {
sequence_id,
failed_installations: vec![],
admitted_via_external_group_id: vec![],
},
)),
};
Expand Down
1 change: 1 addition & 0 deletions crates/xmtp_mls_common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ prost.workspace = true
serde.workspace = true
thiserror.workspace = true
tls_codec.workspace = true
url.workspace = true
xmtp-workspace-hack.workspace = true
xmtp_common.workspace = true
xmtp_configuration.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/xmtp_mls_common/src/app_data/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1169,13 +1169,15 @@ mod tests {
GroupMembershipEntryV1 {
sequence_id: 42,
failed_installations: vec![vec![0xAA; 16]],
admitted_via_external_group_id: vec![],
},
);
entries.insert(
InboxId::from_bytes([0x02; 32]),
GroupMembershipEntryV1 {
sequence_id: 99,
failed_installations: vec![],
admitted_via_external_group_id: vec![],
},
);
let entries = entries
Expand Down Expand Up @@ -1257,6 +1259,7 @@ mod tests {
version: Some(GroupMembershipEntryVersion::V1(GroupMembershipEntryV1 {
sequence_id: 7,
failed_installations: vec![],
admitted_via_external_group_id: vec![],
})),
};
snapshot
Expand Down
Loading
Loading