Skip to content

Don't store repeated universe discovery pages twice - #80

Open
stewartadam wants to merge 1 commit into
mainfrom
claude/project-thread-njq8b9-6-discovery-duplicate-pages
Open

stewartadam wants to merge 1 commit into
mainfrom
claude/project-thread-njq8b9-6-discovery-duplicate-pages

Conversation

@stewartadam

@stewartadam stewartadam commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Universe discovery (E1.31-2016 §8) splits a source's universe list across pages 0 to last_page, and the source resends the whole set every 10 s. When the receiver missed a page, the pages it had already received were pushed again in the next interval. DiscoveredSacnSource::has_all_pages sorts the pages and expects page i at index i, so with pages [0, 0, 1] the source never completed and was never reported as discovered.

handle_universe_discovery_packet now handles a partially discovered source like this:

  • It replaces an earlier copy of the same page number instead of adding a second copy.
  • If the incoming last_page differs from the stored one, it discards the stored pages, because the source's universe list changed size and the old pages are stale.
  • It updates the stored source name from the latest page.

Tests

  • New test_multi_page_discovery_with_repeated_page: page 0, then page 0 again, then page 1. The source is discovered with universes [1, 2, 3, 4].
  • New test_multi_page_discovery_page_count_changes: a page from a 3-page set followed by a full 2-page set leaves only the 2-page result.
  • cargo test and cargo clippy pass, and clippy reports no new warnings.

When a multi-page universe discovery set was missing a page, the pages
already received were pushed again in the next interval. has_all_pages
sorts the pages and expects page i at index i, so with pages [0, 0, 1]
the source was never reported as discovered.

Replace an earlier copy of the same page instead of adding another, and
discard the stored pages if the source's last_page changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KzaQVQThQpmqhvLapk99Vs
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