Skip to content

Commit 977d84a

Browse files
committed
fix(xmtp_api_d14n): close two bidi ledger loss holes under overlapping catch-up waves
1 parent 41b9afb commit 977d84a

2 files changed

Lines changed: 602 additions & 62 deletions

File tree

crates/xmtp_api_d14n/src/queries/bidi.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use std::time::Duration;
2727
use futures::StreamExt;
2828
use futures::stream::BoxStream;
2929
use tokio::sync::{mpsc, oneshot};
30-
use xmtp_common::{AbortHandle, StreamHandle};
30+
use xmtp_common::{AbortHandle, MaybeSend, MaybeSync, StreamHandle};
3131
use xmtp_proto::types::{Topic, TopicKind};
3232

3333
/// Wire-outbound depth. The actor is the sole writer; a transport that stops
@@ -94,10 +94,13 @@ pub trait BidiBinding: Send + 'static {
9494
type Response: Send + 'static;
9595
/// The backend's `Mutate` payload (v3: single `id_cursor`; d14n: vector cursor).
9696
type Mutate: Send;
97-
/// Consumer-facing group message (v3: raw proto; d14n: unified, post-extract).
98-
type GroupMessage: Send;
99-
/// Consumer-facing welcome message (v3: raw proto; d14n: unified, post-extract).
100-
type WelcomeMessage: Send;
97+
/// Consumer-facing group message (v3: raw proto; d14n: unified,
98+
/// post-extract). `MaybeSync` because the transport ledger shares
99+
/// withheld frames between holders via `Arc` inside its actor.
100+
type GroupMessage: MaybeSend + MaybeSync;
101+
/// Consumer-facing welcome message (v3: raw proto; d14n: unified,
102+
/// post-extract). `MaybeSync` for the same reason as `GroupMessage`.
103+
type WelcomeMessage: MaybeSend + MaybeSync;
101104

102105
/// Wrap a `Mutate` as an outbound request frame.
103106
fn mutate_frame(mutate: Self::Mutate) -> Self::Request;

0 commit comments

Comments
 (0)