Repository navigation
fix(files): resolve v2 file paths only on the v2 surface, through the canonical resolver - #9531
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge; no blocking issues remain. SummaryLimits file-path lookup to the three opted-in v2 routes and uses
|
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
… canonical resolver
a3aa8c6 to
1fcf99d
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
…s for workspace authorization
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
Follow-up to #9504, rebuilt on #9527 (authorize the workspace before an unresolved path answers):
resolveActiveWorkspaceFileContextis shared by ~26 callers, so turningfiles/…strings into ids there widened every internal surface: an internal caller passing a file name that starts withfiles/as an id resolved it as a path. It now takes an explicitacceptVfsPathflag, which only the three v2 routes (describe, rename, delete) set. Every other caller keeps id-only semantics.resolveFileReference(folder-first, owner-scoped, at most two rows) instead of the bespokegetWorkspaceFileByVfsPath, which is deleted. One resolver now serves workspace and project files. Its ambiguityconflictmaps onto fix(files): authorize the workspace before resolving a files/ path #9527'sUnresolvedWorkspaceFileVfsPathError, so a member still gets "pass the file id instead" and a non-member the same refusal as for any other path.files/names nothing and is no longer treated as a path; the contract rejects it like any other malformed reference.WorkspaceFileTargetInput; restore's lifecycle resolver takes only the fields it reads.Type of Change
Testing
file-path-references.integration.tsagainst disposable Postgres viabun run test:integration: 13/13. New cases: a caller that didn't opt in resolves no path; a barefiles/; a non-member's personal key on a workspace with personal keys off gets the same answer for an ambiguous, a missing and an existing pathconflictout pre-authorization fails the member, non-member, delegation and personal-key caseslib/workspace-files/application: 245 passChecklist
test-auditauthoring gate)