fix: call abort() in useEffect cleanup to cancel WebDAV request on unmount #40220
fix: call abort() in useEffect cleanup to cancel WebDAV request on unmount #40220Naetiksoni08 wants to merge 1 commit into
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (6)📓 Common learnings📚 Learning: 2026-04-10T22:42:05.539ZApplied to files:
📚 Learning: 2026-04-17T18:33:24.670ZApplied to files:
📚 Learning: 2026-04-17T17:38:12.974ZApplied to files:
📚 Learning: 2026-04-18T12:32:50.305ZApplied to files:
📚 Learning: 2026-03-27T14:52:56.865ZApplied to files:
🔇 Additional comments (1)
WalkthroughFixed improper Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hey, just a gentle ping on this PR! 😊 Happy to address any feedback or make changes if needed. |
Proposed changes (including videos or screenshots)
In
SaveToWebdavModal.tsx, theuseEffectcleanup was returning a reference tofileRequest.current?.abortinstead of calling it:This meant that when the modal was closed mid-upload, the in-progress XMLHttpRequest was never cancelled — leaving a hanging network request and causing a memory leak.
Now when the modal unmounts, abort() is actually invoked, properly cancelling the WebDAV upload request.
Impact
Steps to test or reproduce
Further comments
One-character-class fix — the cleanup arrow function was missing its invocation parentheses, so
abortwas never called.Summary by CodeRabbit