Skip to content

fix(mailbox): ignore duplicate inbound message ids#515

Closed
0xC3B6 wants to merge 1 commit intoEvoMap:mainfrom
0xC3B6:fix/mailbox-inbound-dedup
Closed

fix(mailbox): ignore duplicate inbound message ids#515
0xC3B6 wants to merge 1 commit intoEvoMap:mainfrom
0xC3B6:fix/mailbox-inbound-dedup

Conversation

@0xC3B6
Copy link
Copy Markdown

@0xC3B6 0xC3B6 commented Apr 26, 2026

Summary

  • Make inbound mailbox writes idempotent when the same message id is received more than once.
  • Keep the first stored inbound message and avoid appending duplicate entries to the pending inbound index.
  • Add a regression test covering duplicate inbound ids.

Root cause

writeInbound() always appended the message id to _inbound, even when _messages already contained that id. A retried Hub delivery could therefore make poll() and countPending() report the same message more than once.

Testing

  • node --test test/mailboxStore.test.js

@autogame-17
Copy link
Copy Markdown
Collaborator

Thanks @0xC3B6 — fantastic fix. We ported your change into our internal source tree and shipped it in v1.70.0-beta.5 (npm: @evomap/evolver@1.70.0-beta.5, Release: https://github.com/EvoMap/evolver/releases/tag/v1.70.0-beta.5).

Area: MailboxStore writeInbound idempotency on duplicate ids
Ported commit: 4a63e91

We work primarily in a private source-of-truth repo and publish an obfuscated mirror to this public repo, so we could not merge your branch here directly; your authorship is acknowledged in the release notes and commit trailer. Really appreciate the well-scoped PR and the regression test — that made adoption trivial.

Closing in favor of the shipped release.

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.

2 participants