Repository navigation
Preserve remote event custody under consumer backpressure - #806
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Code Review
This pull request refactors the remote app server client's event delivery and connection state management, introducing a new event-forwarding mechanism and adding comprehensive integration tests for edge cases like write failures and shutdowns. The review feedback highlights a critical backpressure bug where the skipped_events == 0 guard on stream.next() causes head-of-line blocking on best-effort events, halting the WebSocket reader when the consumer queue is full. To resolve this, it is recommended to allow polling to continue and update try_deliver_event to handle events when skipped_events > 0 while preserving FIFO order. Additionally, the single-line formatting applied to InboundServerRequestLedger violates standard Rust style guidelines and should be reverted to standard multi-line formatting for readability.
Summary
Keep required remote events in FIFO custody when the consumer queue is full, while allowing request and control writes to progress. Deliver pending required events and lag notifications before a terminal disconnect, and preserve the existing inbound request-ID lifetime and exhaustion limits.
This integrates the remote-client work from #650 with the current request-ID ledger and in-process client facade. The change is limited to the remote client and its focused library tests.
Validation
Source review completed. Added coverage for backpressure, request-control progress, shutdown, and write-failure event ordering. Full library tests and required checks must pass on GitHub-hosted runners before merging; local builds and tests have not been run.