23: Keep the registrations behind a duplicate slug - #37
Merged
Merged
Conversation
flush() empties the buffer before the loop, so a Config_Exception out of the registrar ended the loop with everything behind the collision in no registrar and in no buffer. A host registering A, a duplicate of A, then C got a report naming A and the duplicate, and silently lost C for the rest of the process -- on both passes, with the site half-working and nothing anywhere mentioning C. Caught per entry now, with the first collision rethrown after the whole batch has been offered. The duplicate still surfaces from the read, where both passes already catch it; what changes is that it no longer takes the entries behind it along.
d4mation
approved these changes
Aug 20, 2026
d4mation
left a comment
Contributor
There was a problem hiding this comment.
Nice! Ideally this should be fixed in a Host plugin before exactly when the Exception was thrown actually mattered, but this is still a good change.
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.
What:
Registry\Reader::flush()offers every buffered registration to the registrar and rethrows the first duplicate-slugConfig_Exceptionafter the loop, instead of letting the first one end it.Usage:
Why this way:
The buffer is emptied before the loop, which is what made the throw lossy. That emptying is deliberate — it stops a second read re-registering what the registrar already holds — but it meant a collision left everything behind it in no registrar and in no buffer. A host got a report naming the two that collided and silently lost the rest, for the rest of the process, on both passes.
The collision still has to surface, so it is rethrown rather than swallowed. Both passes already catch
Config_Exceptionaround the read; this only changes what else survives the trip.The first collision, not the last, so a buffer holding two of them keeps naming the one the host wrote first until it is fixed.