Skip to content

fix: do not panic on duplicate height and priority - #70

Open
Tyagiquamar wants to merge 1 commit into
ChorusOne:mainfrom
Tyagiquamar:fix-duplicate-height-priority-panic
Open

Tyagiquamar wants to merge 1 commit into
ChorusOne:mainfrom
Tyagiquamar:fix-duplicate-height-priority-panic

Conversation

@Tyagiquamar

@Tyagiquamar Tyagiquamar commented Sep 11, 2026 •

Copy link
Copy Markdown

Summary

  • Stop panicking in resolvePriorities when two upgrade or version entries share the same height and priority. That panic currently kills the Blazar process from the upgrade proposals watcher.
  • If the tags match, collapse the duplicate (LOCAL over DATABASE over CHAIN) and keep the loser in the overridden list.
  • If the tags differ, return an error so the watcher can log it and keep running instead of crashing.

Fixes #56

Test plan

  • Unpatched TestSimultaneousProviders still asserts the panic on main.
  • go test -mod=readonly -count=1 ./internal/pkg/upgrades_registry in golang:1.24-bookworm (PASS, 0.106s)
  • go test -mod=readonly -race -count=1 ./internal/pkg/upgrades_registry in golang:1.24-bookworm (PASS, 1.314s)

Identical-tag entries from different providers are collapsed. Conflicting tags return an error instead of crashing the daemon.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Tyagiquamar

Copy link
Copy Markdown
Author

Hi, just following up on this when you get a chance. The branch is up to date and checks are green. If it looks good from your side, it should be ready to merge. Happy to make any changes if needed. Thanks!

@qezz

qezz commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Hi @Tyagiquamar

We appreciate the contribution. It will take some time to review the patch.

Also, please let us know what % of the code has been generated by the LLM.

Thanks!

@Tyagiquamar

Copy link
Copy Markdown
Author

100% of the code in this PR was generated by an LLM. Thank you for reviewing it when you have time.

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.

Panics if same height and priority is used for different upgrade entries

2 participants