Skip to content

fix: preserve client modifiers when emit aborts - #366

Merged
electrohyun merged 2 commits into
mainfrom
fix/preserve-client-modifiers-on-abort
Aug 20, 2026
Merged

fix: preserve client modifiers when emit aborts#366
electrohyun merged 2 commits into
mainfrom
fix/preserve-client-modifiers-on-abort

Conversation

@electrohyun

@electrohyun electrohyun commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

Keeps client Socket modifiers until an emit is dropped as volatile, buffered, or successfully encoded and scheduled. Outgoing observer and payload-encoding failures therefore preserve the pending modifier for the next completed emit, matching Socket.IO.

Shared real/mock cases cover both failure modes, one-shot consumption, reserved-event retention, and the unchanged Server Socket control. ADR 0026 and the generated conformance report record the consumption boundary.

Related issue

Closes #361

Checklist

  • Tests added or updated
  • Behavior verified against real socket.io

@github-actions github-actions Bot added bug Something isn't working 📏 m Pull request changes 50–199 lines labels Aug 20, 2026
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6411c422-13de-4f23-9a66-ae89940b7fac

📥 Commits

Reviewing files that changed from the base of the PR and between 59690e6 and 6d7e904.

📒 Files selected for processing (6)
  • docs/conformance.md
  • docs/decisions/0026-payloads-cross-a-json-snapshot-boundary.md
  • src/on-any-outgoing.test.ts
  • src/payload-serialization.test.ts
  • src/reserved-events.test.ts
  • src/runtime/sockets.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The client now consumes modifiers after outgoing observation and packet encoding. Regression tests cover listener exceptions, encoding failures, and reserved-event rejection. Conformance documentation and the payload decision record describe the updated behavior.

Changes

Client modifier retention

Layer / File(s) Summary
Modifier consumption boundary
src/runtime/sockets.ts, docs/decisions/0026-payloads-cross-a-json-snapshot-boundary.md
ClientSocket.sendEvent retains active flags through outgoing observation and packet creation, then consumes them on each exit path.
Regression coverage
src/on-any-outgoing.test.ts, src/payload-serialization.test.ts, src/reserved-events.test.ts
Tests verify timeout retention after outgoing listener errors, payload encoding failures, and rejected reserved events.
Conformance updates
docs/conformance.md
Conformance entries and source links cover the new timeout-retention cases.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 6d7e9

The PR preserves client modifiers when an emit aborts and adds coverage for the affected cases. No actionable merge-blocking risk remains after normal validation and review.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies preserving client modifiers when an emit aborts, which is the primary change.
Description check ✅ Passed The description explains the client modifier behavior, implementation boundary, tests, documentation, and linked issue.
Linked Issues check ✅ Passed The changes address issue #361 by preserving client modifiers after observation or encoding failures and retaining existing reserved-event and server behavior.
Out of Scope Changes check ✅ Passed The runtime change, regression tests, ADR, and conformance documentation all support the linked issue objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@electrohyun
electrohyun merged commit 875b4c6 into main Aug 20, 2026
17 checks passed
@electrohyun
electrohyun deleted the fix/preserve-client-modifiers-on-abort branch August 20, 2026 13:57
@electrohyun electrohyun self-assigned this Aug 27, 2026
@github-project-automation github-project-automation Bot moved this to Done in smocket Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 📏 m Pull request changes 50–199 lines

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix: preserve client modifiers when emit aborts

1 participant