Repository navigation
fix(project-files): requeue rendered-artifact search after commit and trim Project read transactions - #9063
Merged
Conversation
… trim Project read transactions - Project artifact reads no longer requeue search inside the read transaction, which held the Project and source row shared and then needed them exclusively; the requeue runs after commit with its owner lock bounded by the short artifact-ready lock timeout and is best effort - Artifact, inline, and CSV preview reads authorize from their own snapshots instead of a separate preflight; artifact inputs are snapshotted only when referenced and download with bounded concurrency after a declared-size budget check; the request signal reaches render and compile - Project inline delivery streams and caches content-addressed key requests like workspace inline - Project search admits, withholds previews, and reports provenance after its snapshot commits, classifies provenance only when a gate or delivery observer needs it, and lists folders directly - A Project page embedding another owner's image is a missing input instead of a 500 - Page limits are shared from page-document.server; knip and the CI isolate build are tightened
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[High impact] The changes since the previous review appear safe to merge. SummaryThis PR moves rendered-artifact search requeues after commit and reduces transactions on Project file reads.
No new actionable issues were found in the changes since the previous review.
|
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
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
All changes are on flag-gated Project file paths (behind the
projectsrollout) plus small shared helpers whose workspace behavior is unchanged.readArtifactholds the Project lock and the source row shared, but its final transaction calledmarkFileSearchArtifactReadyInTx, which takes the Project lock exclusively and file rowsFOR UPDATE. Every compiled render did this (a cache hit still returnsartifactKey), so concurrent generated-document reads in one Project could deadlock or wait out the 5 s Project lock timeout. The read now records the search completion and requeues after commit viarequeueFileSearchForRenderedArtifact(lock-free current check, then its own transaction). That transaction now takes the owner lock under the 1 s artifact-ready bound instead of the 5 s Project lock bound; a timeout is caught and logged and never fails the read.prepareFromSnapshot) instead of a separate preflight. Artifact inputs are snapshotted and admitted only when the source references any; the final transaction still rechecks the source, every input, and provenance after storage reads. Artifact: 4 transactions / 3 admissions → 2 / 2 without inputs, 3 / 3 with. Inline and CSV: 3 → 2. Search: drops the nestedlistProjectFileFoldersuse case.workspaceFileCacheControl(contentAddressed)like workspace inline. It no longer lists every Project folder.loadFileSearchDeliveryreturns an explicitcurrentset, and provenance is classified only when a content gate or delivery observer needs it.not_found) instead of a 500, through a typedProjectPageForeignEmbedError.page-document.server.tsand reused.knip.jsoncnarrows theproject-files.tsentry totypes.SearchProjectFileContentInputis un-exported.paths: ["."]andJOBS=4, matchingdocker/app.Dockerfile.Expected rebase conflicts in the open Project file stack:
artifacts.ts,previews.ts,search.ts,artifact-ready.ts,delivery.ts, andchecks.yml; take staging's side.stream,contentLength,contentAddressed).readProjectFileArtifactkeepsfile.folderPathfor its VFS paths.Type of Change
Testing
lib/workspace-files/page-compile.test.ts.content-rendered.integration.ts:not_found.Checklist
test-auditauthoring gate)