fix(web): keep folder drops out of attachment uploads - #12019
StiensWout wants to merge 1 commit into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused bug fix that prevents folder entries from reaching attachment uploads while preserving normal and mixed file drops. The shared handler change is covered by targeted tests and introduces no schema, security, deployment, default-setting, or static-analysis configuration changes. You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
All clear
Posted via Macroscope — Effect Service Conventions
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe workspace drop handler now inspects drag items, rejects folders, preserves valid files, and reports skipped folders. Tests cover mixed drops, MIME-less files, missing entry metadata, and fallback behavior. ChangesWorkspace Drop Filtering
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The folder filtering behavior preserves valid file drops and does not reattach rejected folders through the fallback path. No actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Reviewed the non-blocking docstring-coverage warning. The changed handler has a nearby comment explaining why directory metadata must be read synchronously during the drop event. Extra docstrings for this existing handler and its test helper would repeat the code; the repository's guidance favors comments that explain behavior or constraints. No code change is needed for that warning.
|
Dropping a folder creates a failed attachment and blocks Send. Filter directory entries in the shared workspace drop handler before they reach the uploader. Mixed drops still attach real files, and a folder drop explains how to reference an accessible path.
Fixes #11961.
The same handler covers chat, sidebar thread rows, sidebar search results, and the legacy sidebar on web and desktop. Files without MIME types and drops without entry metadata keep working.
Verification
git diff --checkpass.Input.dispatchDragEvent, against an isolated T3 server:ERR_FILE_NOT_FOUND; Send disabledBrowser inspection confirmed
isDirectory: truefor the folder andfalsefor the text file. Desktop uses the same handler; a packaged desktop build was not separately exercised.Before
After
Prepared for Wout by
gpt-6in Codex through T3 Code.Summary by CodeRabbit