Skip to content

feat(config): avoid duplicate pair_reg event on re-registration - #438

Merged
mikewheeleer merged 1 commit into
StableRoute-Org:mainfrom
Baskarayelu:feature/config-410-event
Jul 30, 2026
Merged

feat(config): avoid duplicate pair_reg event on re-registration#438
mikewheeleer merged 1 commit into
StableRoute-Org:mainfrom
Baskarayelu:feature/config-410-event

Conversation

@Baskarayelu

Copy link
Copy Markdown
Contributor

Summary

register_pair/register_pairs are documented as idempotent, but previously fired a fresh pair_reg event on every call, including a redundant re-assertion of an already-registered pair. This adds a check against the existing registration state so pair_reg only fires on the genuine unregistered→registered transition, satisfying the 'no duplicate emissions' requirement for config-state-change events.

Adds two tests: single register_pair re-call doesn't duplicate the event, and a register_pairs batch mixing an already-registered pair with a fresh one only emits for the fresh one.

Test output

As noted in #409's PR, main currently fails cargo build --tests at HEAD with 103 pre-existing, unrelated errors (duplicate symbol definitions from a prior merge, reproducible via git stash with zero local changes). This PR adds zero additional errors — confirmed by diffing the error output before/after this change (identical error set, none referencing the touched functions or new tests).

Closes #410

@mikewheeleer
mikewheeleer merged commit bc084f6 into StableRoute-Org:main Jul 30, 2026
0 of 2 checks passed
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.

Emit a dedicated event when config state changes

2 participants