Repository navigation
fix(artifacts): show a settled preview capture only to the artifact's creator - #33
Merged
fforres merged 1 commit intoOct 20, 2026
Conversation
… creator
A settled preview capture is taken after the artifact's queries resolve,
so it holds whatever data the capturing viewer could see. Since org-tier
artifacts are open to every member, any member's capture overwrote the
shared preview column and was shown to everyone.
The capture now goes to its own `preview_capture` column, and setPreview
stores it only for the artifact's creator (a personal row, or an org row
whose `created_by` is the caller). Anyone else gets `{ stored: false }`.
Readers give the creator their capture, falling back to the layout
preview. Every other member gets the data-free layout preview, or nothing
when a legacy row holds an image snapshot there. An overwrite clears the
capture with the rest of the render-derived columns.
Includes the cloud migration and a D1 upgrade test.
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.
Stacked on #32 (needs its
created_bycolumn).A settled preview capture is taken after the artifact's queries resolve, so it contains whatever data the capturing viewer could see. Since #31 made artifacts org-tier, any member who opened an artifact could overwrite its single
previewcolumn with a snapshot of their data, and that snapshot was then shown to everyone.Change
preview_capturecolumn.previewkeeps only the data-free layout preview written at save time.setPreviewstores the capture only for the artifact's creator: a personal row, or an org row whosecreated_byis the caller. Anyone else, and every caller on a legacy row with no creator, gets{ stored: false }.preview.preview_capturealong with the other columns derived from the render.0024, plus a D1 upgrade test.All capture paths go through
setPreview: the console's shell asks for the save-preview tool, which becomesPUT /artifacts/:id/preview. MCP hosts never ask for captures.Tests
packages/core/sdk/src/artifacts.test.ts,capture privacy: creator vs member previews, a member's capture is not stored, legacy rows with no creator, personal rows, an overwrite clears the capture, a legacy image is hidden from non-creators, list previews, and share keeps the capture.packages/core/api/src/artifacts/artifacts-preview.test.ts: the PUT answersstored: falsefor a non-creator andstored: truefor the creator.Known limit. A legacy settled markup capture already sitting in
previewcan't be told apart from layout markup, so it stays visible to every member until that artifact is saved again.