Skip to content

fix: ensure BaseRouteHandler.on_registration is only called once per handler#4738

Merged
provinzkraut merged 1 commit into
mainfrom
fix-call-on-registration
Apr 26, 2026
Merged

fix: ensure BaseRouteHandler.on_registration is only called once per handler#4738
provinzkraut merged 1 commit into
mainfrom
fix-call-on-registration

Conversation

@provinzkraut

@provinzkraut provinzkraut commented Apr 26, 2026

Copy link
Copy Markdown
Member

Fix an issue that would lead to BaseRouteHandler.on_registration being called more than once if a handler instance was registered for multiple paths (i.e. @get(["/a", "/b"])). This fix only targets v3 even though the behaviour also exists in v2. In v2 this is much harder to fix and uncertain which side effects it might introduce in downstream apps due to the mutable nature of the handlers pre #3900.


📚 Documentation preview 📚: https://litestar-org.github.io/litestar-docs-preview/4738

@codecov

codecov Bot commented Apr 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.38%. Comparing base (d63f917) to head (0dbccc7).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
litestar/app.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4738   +/-   ##
=======================================
  Coverage   67.37%   67.38%           
=======================================
  Files         292      292           
  Lines       14996    14999    +3     
  Branches     1684     1685    +1     
=======================================
+ Hits        10104    10107    +3     
  Misses       4756     4756           
  Partials      136      136           

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@provinzkraut
provinzkraut force-pushed the fix-call-on-registration branch from 32cc9a9 to 0dbccc7 Compare April 26, 2026 17:34
@provinzkraut
provinzkraut merged commit 326e988 into main Apr 26, 2026
25 checks passed
@provinzkraut
provinzkraut deleted the fix-call-on-registration branch April 26, 2026 17:40
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.

1 participant