-
Notifications
You must be signed in to change notification settings - Fork 74
create a d14n-ordered stream #2932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This PR is part of a stack of 12 bookmarks:
Created with jj-stack |
|
Claude finished @insipx's task —— View job Code Review CompleteReview Date: December 15, 2025 20:51 UTC I've reviewed the d14n-ordered stream implementation. The overall design is solid, introducing offline ordering with orphan icing. Most issues have been identified by macroscopeapp. Here are additional high-priority concerns not already covered: Critical Issues1. Infinite Loop Risk in The recursive implementation lacks cycle detection. While macroscopeapp flagged this, I want to emphasize the severity: if two envelopes form a dependency cycle (A depends on B, B depends on A), this will recurse indefinitely until stack overflow. 2. Missing Test Coverage for The new
Recommendation: Add tests for: #[xmtp_common::test]
async fn test_ordered_stream_with_missing_dependencies()
#[xmtp_common::test]
async fn test_ordered_stream_error_propagation()High-Priority Issues3. Incorrect impl RetryableError for OrderedStreamError {
fn is_retryable(&self) -> bool {
false // ❌ Always returns false
}
}This breaks retry logic for transient matches!(self, OrderedStreamError::Resolver(err) if err.is_retryable())4. Error Type Semantics The comment says "this is an error which should never occur, and if it does is a bug in libxmtp", but the code treats it as a regular error. If this truly represents an invariant violation:
Performance Considerations5. Cloning .topic_cursor(self.topic_cursor.clone()) // HashMap clone on every stream item
6. Memory Swap for Cursor Update let (envelopes, mut new_cursor) = ordering.into_parts();
let this = self.as_mut().project();
std::mem::swap(this.topic_cursor, &mut new_cursor);This is correct but slightly awkward. Direct assignment would be clearer: *this.topic_cursor = new_cursor;Code Quality7. The new /// A typed no-op resolver that returns an empty resolution result.
/// Used in streaming contexts where dependencies are expected to arrive
/// in the stream itself rather than being actively fetched.
SecurityNo security concerns identified. The implementation correctly:
Test Coverage SummaryFrom codecov report:
Recommendations Priority
Overall this is a well-structured implementation that fits cleanly into the existing ordering architecture. The main gaps are in test coverage and the two critical issues flagged by macroscopeapp. |
4e9d006 to
46e175d
Compare
950a484 to
73192df
Compare
Add d14n-ordered group message streams and offline causal ordering with icing in
|
73192df to
971b4a4
Compare
971b4a4 to
5ac4ca2
Compare
46e175d to
c47bc4a
Compare
5ac4ca2 to
5afbe75
Compare
c47bc4a to
95a95c7
Compare
0e4dc44 to
b159bdc
Compare
a8ba978 to
0cc1b60
Compare
254c39d to
57b66f7
Compare
d1cb961 to
4ec3e28
Compare
4ec3e28 to
f19d0ff
Compare
50803e3 to
8c483c4
Compare
8c483c4 to
77f864f
Compare
f19d0ff to
189f79a
Compare
189f79a to
d0c293f
Compare
77f864f to
63b60a9
Compare
63b60a9 to
501ea00
Compare
d0c293f to
cc932d2
Compare
501ea00 to
786d35a
Compare
cc932d2 to
3ec02cb
Compare
786d35a to
98a9a23
Compare
3ec02cb to
4d7d1b4
Compare
98a9a23 to
62346bb
Compare
46e5a2a to
76e0de7
Compare
62346bb to
1340914
Compare
76e0de7 to
cd80e47
Compare
closes #2790