Skip to content

feat(gateway): make sends idempotent with a client nonce - #106

Merged
m1ngsama merged 1 commit into
mainfrom
feat/gateway-nonce
Oct 11, 2026
Merged

m1ngsama merged 1 commit into
mainfrom
feat/gateway-nonce

Conversation

@m1ngsama

Copy link
Copy Markdown
Owner

Universe marks a message as failed when the socket drops before the echo arrives; retrying it posted a second copy (m1ngsama/universe#16).

A send frame may carry a nonce (up to 64 characters). The gateway remembers (handle, nonce) for ten minutes; a resend with the same pair is answered with the original message frame instead of being posted again. Message frames carry the nonce back so the client can settle the right local bubble. Sends without a nonce behave as before.

Verified: bun test (50 pass), bunx tsc --noEmit; deployed to chat.m1ng.space (previous binary kept in /root).

A send may carry a nonce; a resend with the same nonce from the same
handle within ten minutes is answered with the original message instead
of being posted again, so a client retrying after a dropped socket
cannot duplicate a message.
@m1ngsama
m1ngsama merged commit aaa6017 into main Oct 11, 2026
2 of 4 checks passed
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