Skip to content

[AI-8th] Fixes duplicate publisher registration detection in DefaultRegistryClient#405

Merged
huanglongchao merged 1 commit into
sofastack:masterfrom
pmupkin:PublisherRegistration-hashcode
Apr 28, 2026
Merged

[AI-8th] Fixes duplicate publisher registration detection in DefaultRegistryClient#405
huanglongchao merged 1 commit into
sofastack:masterfrom
pmupkin:PublisherRegistration-hashcode

Conversation

@pmupkin
Copy link
Copy Markdown
Contributor

@pmupkin pmupkin commented Apr 25, 2026

This PR(Related issue #47) fixes duplicate publisher registration detection in DefaultRegistryClient.

DefaultRegistryClient uses PublisherRegistration as the key in registrationPublisherMap, but PublisherRegistration did not override equals and hashCode, so two registrations with the same registration attributes were treated as different keys. As a result, duplicate publisher registrations could bypass the existing duplicate check.

Changes

  • Implemented equals and hashCode for PublisherRegistration.
  • Added unit coverage for PublisherRegistration equality and hash code behavior.
  • Added a DefaultRegistryClient test to verify duplicate publisher registration now throws DuplicateException.
  • Updated the multi-unregister test to use different publisher groups when registering multiple publishers with the same dataId.

@huanglongchao
Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@huanglongchao huanglongchao merged commit fb8d3b1 into sofastack:master Apr 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants