Skip to content

fix(core): keep a device's newest advert when an older one arrives later - #356

Merged
Mearman merged 1 commit into
mainfrom
fix/directory-keeps-newest-advert
Oct 19, 2026
Merged

Mearman merged 1 commit into
mainfrom
fix/directory-keeps-newest-advert

Conversation

@Mearman

@Mearman Mearman commented Oct 19, 2026

Copy link
Copy Markdown
Member

A session's directory takes whichever advert for a device arrives last. A hub or relay that forwards adverts it holds from earlier can deliver an older one after a newer one, which rolled the device back, and a device whose versions kept arriving interleaved alternated between them on every directory event. In agent-comms this made every hub directory event look like new proofs for the same devices and kept a bridge's CPU high.

The directory now keeps the advert with the greater signed snapshot-seconds, matching the rule the relay hub already applies to registrations. The threshold-* suites fail in this checkout only because wasm-dist is not built.

A session applied gossiped adverts in arrival order, so an older advert
forwarded by a hub or gateway after a newer one rolled the device back
in the session directory. A device whose two versions kept arriving
interleaved alternated between them on every directory event.

The directory now keeps the advert with the greater signed
snapshot-seconds, the same rule the relay hub applies when registering a
device.
@Mearman
Mearman marked this pull request as ready for review October 19, 2026 12:33
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ⚠️ Failed 2026-10-19T12:33:06.564308Z ee6057c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@Mearman
Mearman merged commit e0b0a98 into main Oct 19, 2026
9 checks passed
@Mearman
Mearman deleted the fix/directory-keeps-newest-advert branch October 19, 2026 12:33
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 4.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant