Skip to content

feat: add support for server requested acknowledgements - #15

Merged
fr3shw3b merged 1 commit into
mainfrom
feat/send-acknowledgements
Aug 16, 2026
Merged

fr3shw3b merged 1 commit into
mainfrom
feat/send-acknowledgements

Conversation

@fr3shw3b

@fr3shw3b fr3shw3b commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added automatic acknowledgements for server messages that request them.
    • Supports acknowledgements in both JSON and binary communication modes.
    • Duplicate messages are acknowledged without being surfaced again.
    • Acknowledgement responses include the message ID and timestamp.
  • Documentation

    • Updated message-sending documentation with acknowledgement behavior and requirements.
  • Tests

    • Added coverage for acknowledgement encoding, formats, duplicates, and missing message IDs.

@fr3shw3b
fr3shw3b merged commit 1e4d75d into main Aug 16, 2026
1 check failed
@coderabbitai

coderabbitai Bot commented Aug 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7fb119ab-f973-4267-a4e2-a100ea12e5c5

📥 Commits

Reviewing files that changed from the base of the PR and between 044c942 and 99b6279.

📒 Files selected for processing (7)
  • README.md
  • src/client.ts
  • src/protocol/binary-codec.ts
  • src/protocol/json-codec.ts
  • tests/unit/binary-codec.test.ts
  • tests/unit/client-acks.test.ts
  • tests/unit/json-codec.test.ts

📝 Walkthrough

Walkthrough

The client now acknowledges eligible server messages in JSON or binary format. Acknowledgements include the message ID and timestamp. The client sends acknowledgements before route validation and deduplication, including for duplicate deliveries.

Changes

Message acknowledgements

Layer / File(s) Summary
Acknowledgement encoding and codec coverage
src/protocol/binary-codec.ts, src/protocol/json-codec.ts, tests/unit/binary-codec.test.ts, tests/unit/json-codec.test.ts
The codecs encode acknowledgements with the message ID and timestamp. Tests validate the binary framing and JSON event format.
Client acknowledgement flow
src/client.ts, tests/unit/client-acks.test.ts, README.md
The client acknowledges requested messages before route validation and deduplication. It selects binary or JSON output from negotiated capabilities. Tests cover missing IDs, duplicates, transport capabilities, and payloads. The README documents the behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Server
  participant Client
  participant sendAck
  participant WebSocket
  Server->>Client: Deliver message with messageId and ack request
  Client->>sendAck: Acknowledge before route validation or deduplication
  sendAck->>WebSocket: Send negotiated binary or JSON acknowledgement
  Client->>Client: Apply route handling and deduplication
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/send-acknowledgements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@fr3shw3b
fr3shw3b deleted the feat/send-acknowledgements branch August 16, 2026 20:49
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