Repository navigation
test(files): prove files/ VFS path downloads over real HTTP instead of a mocked route call - #9662
Merged
Merged
Conversation
…f a mocked route call The v2 file download case added in #9637 passed the decoded path straight to the handler and asserted on the mocked use case, so it could not catch an encoded files/ path failing to reach the route or resolving to the wrong file. The file delivery e2e now uploads same-named files at the root and in a folder and downloads each by its %2F-encoded VFS path through the running app.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[Low impact] This test-only PR appears safe to merge. SummaryReplaces the mocked VFS download test with real HTTP coverage.
Reviews (1) · Last reviewed commit: "test(files): keep the HTTP check to the ..." · Reviewed by Greptile |
Collaborator
Author
|
Red proof: the |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Greptile flagged on the v0.9.43 release PR (#9660) that the v2 file download case added in #9637 mocked the download use case, passed the already-decoded route parameter straight to the handler, and asserted
toHaveBeenCalledWithon the mock. CLAUDE.md forbids that pattern, and it could not catch the one thing the integration test does not reach: Next.js routing a%2F-encodedfiles/...path into the single[fileId]segment, which is exactly howsim files get files/...calls the route (encodeURIComponenton path params).apps/sim/scripts/test-file-delivery-e2e.ts(CI:project-fileshttp e2e group, viatest-project-files-e2e.ts): it creates aVfsDocsfolder, a rootvfs-report.csvand a same-named copy in the folder, then downloadsfiles/VfsDocs/vfs-report.csvandfiles/vfs-report.csvthrough/api/v2/files/<encoded path>with an API key over real HTTP. Each must return its own bytes, and a missing path returns 404. A routing bug that truncated the segment at/would land on the root copy or 404.lib/workspace-files/delivery.integration.ts(unchanged).No product code changes.
Testing
tmp/vfs-download-redis this test plus the route withacceptVfsPath: trueremoved; thechecksworkflow dispatched on it must fail theproject-filese2e group on this check (run linked in a comment below once it finishes).e2e (project-files).biome checkon both files.