Skip to content

fix(handlers): take the same handler registered twice quietly - #64

Merged
skjnldsv merged 1 commit into
mainfrom
fix/repeat-registration
Sep 29, 2026
Merged

skjnldsv merged 1 commit into
mainfrom
fix/repeat-registration

Conversation

@skjnldsv

Copy link
Copy Markdown
Contributor

Every app bundles its own copy of the package, so on 36 the server's copy and an app's (nextcloud/assistant#670) both register the default handlers, and each duplicate logs Handler with id images is already registered.

registerHandler() now skips a registration with the same id and tagname at debug level, keeping the first. Another handler claiming a taken id still warns.

Covered by unit tests, not checked on a real page with two copies.

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

Every app bundles its own copy of the package, so the server's copy and
an app's both register the default handlers, and each duplicate logged
a warning. A repeat registration with the same id and tagname is now
skipped at debug level, keeping the first. Another handler claiming a
taken id still warns.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv added status: review Waiting for reviews type: bug 🐛 Something isn't working AI assisted labels Sep 29, 2026
@skjnldsv skjnldsv self-assigned this Sep 29, 2026
@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.78%. Comparing base (c36a965) to head (38b2455).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #64      +/-   ##
==========================================
+ Coverage   88.76%   88.78%   +0.02%     
==========================================
  Files          39       39              
  Lines        2760     2765       +5     
  Branches      567      569       +2     
==========================================
+ Hits         2450     2455       +5     
  Misses        303      303              
  Partials        7        7              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@skjnldsv
skjnldsv merged commit b49e6c8 into main Sep 29, 2026
18 checks passed
@skjnldsv
skjnldsv deleted the fix/repeat-registration branch September 29, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted status: review Waiting for reviews type: bug 🐛 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant