Repository navigation
Don't store repeated universe discovery pages twice - #80
Open
stewartadam wants to merge 1 commit into
Open
stewartadam wants to merge 1 commit into
stewartadam wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_pagessorts the pages and expects pageiat indexi, so with pages[0, 0, 1]the source never completed and was never reported as discovered.handle_universe_discovery_packetnow handles a partially discovered source like this:last_pagediffers from the stored one, it discards the stored pages, because the source's universe list changed size and the old pages are stale.Tests
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].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 testandcargo clippypass, and clippy reports no new warnings.