Skip to content

fix(rust): preserve fragmented updates and isolate timeout ownership - #67

Open
petralithic wants to merge 1 commit into
loro-dev:mainfrom
petralithic:pr/client-fragment-reassembly-20261110
Open

petralithic wants to merge 1 commit into
loro-dev:mainfrom
petralithic:pr/client-fragment-reassembly-20261110

Conversation

@petralithic

Copy link
Copy Markdown

Fragmented updates can lose received data or fail to complete when an empty fragment arrives, a header repeats, or an old timeout fires after the same batch key is reused. A sender-declared total can also trigger an excessive output reservation.

Track arrival separately from payload length, retain the existing batch and deadline on duplicate headers, and cancel completed timers while checking entry ownership. Size the assembled buffer from actual received bytes. Wire encoding and acceptance of payloads whose declared size is smaller than their actual size remain unchanged.

The Rust WebSocket client already uses Tokio. Timeout cancellation uses its existing sync feature. The patch enables test-util only for tests so they can advance a simulated clock. Production builds use the same Tokio features as before.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant