fix(upload): correct on_drop_rejected args spec#6342
fix(upload): correct on_drop_rejected args spec#6342BABTUNA wants to merge 2 commits intoreflex-dev:mainfrom
Conversation
Greptile SummaryThis PR fixes a bug where Confidence Score: 5/5Safe to merge — targeted one-line spec fix with a regression test and updated pyi hash. All findings are P2 (minor test coverage gap). The fix is correct, well-scoped, and consistent with the existing No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[react-dropzone onDropRejected callback] -->|FileRejection array| B[on_drop_rejected trigger]
B --> C{Component}
C -->|GhostUpload| D["_on_drop_rejected_spec: list of dict"]
C -->|Upload| D
D --> E[User event handler receives list of FileRejection dicts]
Reviews (1): Last reviewed commit: "Fix upload on_drop_rejected args spec" | Re-trigger Greptile |
All Submissions:
github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md) file?
Requests for the desired
changed?
Type of change
New Feature Submission:
Changes To Core Features:
like us to include them?
Description
This fixes the
Upload.on_drop_rejectedtrigger args spec.Before this change,
on_drop_rejectedused the same spec ason_drop(
list[rx.UploadFile]), which is incorrect for rejected files.Now
on_drop_rejecteduses its own spec (list[dict[str, Any]]) and iswired on both
GhostUploadandUpload.Changes included:
_on_drop_rejected_spec = passthrough_event_spec(list[dict[str, Any]]).on_drop_rejectedtype annotations inGhostUploadandUpload.test_on_drop_rejected_uses_file_rejection_payload_specpyi_hashes.jsonforpackages/reflex-components-core/src/ reflex_components_core/core/upload.pyi.Validation
uv run pytest tests/units/components/core/test_upload.py -quv run ruff check packages/reflex-components-core/src/ reflex_components_core/core/upload.py tests/units/components/core/ test_upload.pyCloses #6205