Repository navigation
Copy the page on the server when "+" adds one - #275
Merged
Merged
Conversation
A queued page.add may name a page to copy. The server copies that page's live items and lineups onto the new page, under copy ids that keep their roots, in the same transaction that adds it, so the page never appears without its content. A placed image still uploading is left out; a page too large to copy refuses the add before anything is written. "Duplicate strategy" now copies through the same code (lib/contentCopy). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 45 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
A batch is one transaction, so every page it copies now draws on one budget: two large copies can no longer push the batch past Convex's limits, where it would fail, and fail again on every retry. A lineup image several pages show is charged to a copy once, as it is copied once, so "Duplicate strategy" refuses no strategy it accepted before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copies in one batch share a budget. A copy after it is spent failed only after reading a row, so many copies could still read past Convex's limit. A spent budget now refuses before reading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-add-copies-content
A copied placed image now names its source's picture (assetId) rather
than getting a picture of its own. Within a strategy nothing is copied
or uploaded, so "+" no longer leaves out an image still uploading: the
copy shows the picture whenever the upload lands. A copy into another
strategy ("Duplicate strategy") brings each picture once, under the same
id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-add-copies-content
…e-add-copies-content
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-add-copies-content
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.
In local mode, "+" adds a copy of the page on screen. In the cloud it adds a blank page. This PR is the server half of fixing that: the server copies the page as it adds it.
What changes
page.addop can carry an optionalcopyContentFromPagePublicId. When it does, the server copies that page's live items and lineups onto the new page in the same transaction that adds it. The new page never shows up without its content.<root>~cp1~<uuid>, from Keep items' roots when a cloud strategy is duplicated #273), so items glide from the page to its copy when the page turns.assetId, from Let an image show another image's picture #276), and lineup images keep their ids. Within a strategy nothing is copied or uploaded, so an image still uploading is copied too, and its copy shows the picture once the upload lands.PAGE_TOO_LARGE_TO_COPYand leaves nothing behind.convex/lib/contentCopy.ts). A copy into another strategy brings each picture once, under the same id, sharing the stored bytes. Before, each copied placed image got a new picture id. It still refuses an image whose upload hasn't finished, and a lineup image shown on several pages is still charged to its budget once.Compatibility
Checks
npx tsc --noEmit: clean.npm run test:convex: 289 passing on the combined branch. New tests:Stacked on #273, with #276 merged in. Sync protocol change, so Dara looks first.
ci: convex contract analyze test
🤖 Generated with Claude Code