feat(screenshots): migrate to new service and delete on push#189
Open
jomifepe wants to merge 6 commits into
Open
feat(screenshots): migrate to new service and delete on push#189jomifepe wants to merge 6 commits into
jomifepe wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f6edcbd. Configure here.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
jomifepe
commented
May 26, 2026
|
|
||
| const extension = SUPPORTED_IMAGE_MIME_TYPES[type]; | ||
| const digest = createHash("md5") | ||
| const digest = createHash("sha1") |
Contributor
Author
There was a problem hiding this comment.
This is to match Type Builder (md5 is not native to web), not critical, but not harmful.
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
slice add-variation,slice edit-variation)GET /screenshot/presigned-urland align S3 keys with the new service:{repo}/shared-slices/{sliceId}/{variationId}/{sha1}{ext}(SHA1 digest, dot-separated extension)POST /screenshot/deleteduringprismic pushwhen remote slices are removed, matching editor behavior (failures are logged as warnings so the slice delete still completes)Closes #145
Test plan
slice-add-variationandslice-edit-variationscreenshot uploadspush.serial.test.ts— push deletes a remote slice and cleans up its screenshot files (usestest/fixtures/slice-screenshot.png)--screenshoton a local PNGMade with Cursor
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.Note
Medium Risk
Swaps presigned-upload and storage-key logic (new host and SHA1 keys) and adds best-effort screenshot deletion during push, which could leave orphaned files if the delete API fails.
Overview
Slice variation screenshot uploads now use the internal screenshot service (
api.internal…/screenshot/) instead of acl-provider: presigned POST credentials come frompresigned-url, and object keys use a SHA1 content hash (replacing MD5) under{repo}/shared-slices/{sliceId}/{variationId}/….prismic pushcallsdeleteScreenshotsafter each remote slice removal (failures are logged as warnings so the slice delete still completes). Serial E2E coverage uploads a screenshot, pushes a local slice delete with--force, and asserts both the slice and its screenshot keys are gone.Reviewed by Cursor Bugbot for commit 221666d. Bugbot is set up for automated code reviews on this repo. Configure here.