Repository navigation
fix(upload): handle unknown event handlers - #6861
FarhanAliRaza merged 6 commits into
Conversation
Signed-off-by: hariomloharapps <[email protected]>
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
Thanks for the focused fix and regression test. I think there is one blocker before this can merge.
registered_event_handler = RegistrationContext.get().event_handlers.get([ Because [handler_name] is a list, this raises TypeError: cannot use 'list' as a dict key for both unknown handlers and uv run --frozen pytest tests/units/test_app.py::test_upload_file_unknown_handler_returns_400 tests/units/ Result: 4 failed, all from that lookup. This should be: registered_event_handler = RegistrationContext.get().event_handlers.get( Also, since this is a user-facing upload bugfix for #6860, towncrier check currently fails because there is no news |
Done 😊 |
|
One maintainer-readiness change is still needed: because this is a user-facing bugfix in
Suggested content:
I also don’t see unit or integration CI results for the current commit yet. Please confirm the focused test and |
|
LGTM! |
When it will be merged |
Merging this PR will improve performance by 3.17%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_var_access[mutable_dict] |
47 ms | 45.6 ms | +3.17% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing hariomlohardev:fix/6860-upload-unknown-handler (edf0bf9) with main (5d9724e)
Footnotes
-
8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
All Submissions:
Type of change
New Feature Submission:
Not applicable — this is a bug fix.
Changes To Core Features:
Description
Fixes #6860
The upload endpoint previously performed a direct registry lookup for the
Reflex-Event-Handlerheader. If the header referenced an unknown or stale event handler, the lookup raised an unhandledKeyErrorand resulted in a 500 response.This change:
.get().400 Bad Requestfor an unknown upload event handler.Valid registered upload handlers continue to follow the existing behavior.