Repository navigation
fix(platform): hide project-scoped files from the WebDAV tree - #2559
Merged
Merged
Conversation
Project files (documents.projectId set) carry no folderId, so every WebDAV lookup — filtering on lifecycle only — treated them as root-level hub documents: any org member with an app password could list, read, overwrite (PUT name collision), delete, move, and copy them (#2545). Make WebDAV a hub-only surface, mirroring the REST API's opaque 404s: - visibility.ts owns the predicate (active AND not project-scoped), built on documents/access.ts isProjectScopedDocument — the same canonical scope check PR #2549 gives the platform surfaces. - tree_queries: listCollection (documents and .trash), leaf resolution (title and <title>_<docId> forms), the .trash leaf lookup, and getDocumentProps all exclude project docs. - tree_mutations: ingestPutBlob's overwrite lookup and findCollision are blind to project docs (a colliding PUT creates an independent hub document); softDeleteDocument, moveResource, and copyResource answer NOT_FOUND for a project-scoped target; the folder cascade/copy/fixup recursions skip project rows. Regression tests cover root and in-folder list/resolve, props, trash, PUT collision, delete, move, copy, and MKCOL against seeded project docs. Closes #2545
larryro
added a commit
that referenced
this pull request
Jul 8, 2026
documents/access and webdav/visibility landed in #2559 without the regenerated _generated/api.d.ts.
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.
Problem
Project files (
documents.projectIdset) carry nofolderId, so the WebDAV tree — which filtered on lifecycle only — treated them as root-level hub documents. Any org member with an app password could:tree_queries.listCollection),tree_mutations.ingestPutBlobbound a colliding PUT to the project row and replaced its blob),softDeleteDocument,moveResource,copyResourceand the name-collision lookups had no project gate).Fix
Make WebDAV a hub-only surface, mirroring the REST API's opaque 404s. The visibility predicate — active AND not project-scoped — lives in
convex/webdav/visibility.ts(isWebdavVisibleDocument), built on the canonical scope checkisProjectScopedDocumentinconvex/documents/access.ts.tree_queries:listCollection(both thedocumentsand.trashnamespaces), leaf resolution (title match and the<title>_<docId>disambiguation form), the.trashleaf lookup, andgetDocumentPropsexclude project docs — every method handler (PROPFIND/GET/PUT/DELETE/MOVE/COPY/LOCK/PROPPATCH) routes through these, so a project file's path behaves as not-found everywhere.tree_mutations: theingestPutBloboverwrite lookup andfindCollisionare blind to project docs, so a PUT whose filename collides with a project file creates an independent hub document and MKCOL/MOVE/COPY are neither blocked by nor overwrite-trash them;softDeleteDocument,moveResource, andcopyResourceanswerNOT_FOUNDfor a project-scoped target; the folder cascade/copy/fixup recursions skip project rows (defense-in-depth — project docs carry nofolderIdtoday).convex/webdav/README.mddocuments the hub-only rule next to the Hono-trust split.WebDAV cannot evaluate project membership (the Hono-trust split asserts only
organizationId+userId), so per the issue the rule is uniform not-found for every caller; project members reach their files through the project surfaces. Note:documents/access.tshere is a minimal extraction ofisProjectScopedDocument— identical name/signature/doc comment to the fuller file PR #2549 introduces, so whichever lands second resolves trivially to the superset.Tests (red → green)
New
convex/webdav/tree_queries.test.tsand atree_mutations.test.tsproject-scope block, all failing on main (13 failed) and passing with the fix:listCollectionexclude project docs; hub docs still list,resolvePathnot_found for a project doc (root, in-folder,<title>_<docId>form); hub docs still resolve,getDocumentPropsreturns null for a project doc,.trashneither lists nor resolves a trashed project doc,NOT_FOUND, row unchanged,Overwrite: Tonto a project file's name never trashes it; MKCOL is not blocked by one.Verified: all 14 webdav suites green (247 tests),
convex/documentssuite green (226 tests), platformtsc --noEmitclean,oxlint --type-awareclean,knipclean,oxfmt --checkclean.Closes #2545