fix(files): never dedup external URL fetches by path filename#4733
Conversation
External URL fetches in the file parse route were keyed on the path filename, so two distinct URLs whose paths ended in `image.png` (e.g. every Slack clipboard paste) collided in the workspace cache and returned stale bytes from a prior fetch. Extracts the fetch + save flow into `fetchExternalUrlToWorkspace` so the broken dedup pattern can't be reintroduced. The helper always downloads; `uploadWorkspaceFile` handles name collisions on save by suffixing (`image.png` -> `image (1).png` -> ...).
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Extracts external URL validation/fetch (+ optional workspace save) into a new Reviewed by Cursor Bugbot for commit ab766f5. Configure here. |
Greptile SummaryThis PR fixes a cache-collision bug where two external URLs sharing the same path tail (e.g. every Slack clipboard paste is
Confidence Score: 5/5Safe to merge — the change is a focused bug fix that removes a filename-based cache lookup and replaces it with an always-fresh download helper, without altering any parse or auth logic downstream. The root-cause fix is correct: the collision between distinct URLs sharing the same path tail is eliminated by removing the filename-based dedup path entirely. SSRF protection, permission checks, and parse logic are all preserved. The new helper is well-isolated, all previous thread concerns were addressed in the same commit, and the test suite directly pins the behavior that was broken. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(files): distinguish non-member from ..." | Re-trigger Greptile |
…kip log Splits the workspace-save skip branch so non-members (permission === null) log 'user is not a workspace member' instead of the misleading 'lacks write permission'. Adds a test covering the null case so the relaxed behavior (vs. the prior route's hard 'File not found') is explicit.
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit ab766f5. Configure here.
Summary
image.png(e.g. every Slack clipboard paste) collided in the workspace cache and returned stale bytes from a prior fetchfetchExternalUrlToWorkspacehelper so the broken dedup pattern can't be reintroduceduploadWorkspaceFilealready disambiguates same-name collisions on save (image.png->image (1).png-> ...)Type of Change
Testing
Checklist