Repository navigation
Keep items' roots when a cloud strategy is duplicated - #273
Open
SunkenInTime wants to merge 2 commits into
Open
SunkenInTime wants to merge 2 commits into
SunkenInTime wants to merge 2 commits into
Conversation
A duplicate gave every item and lineup a fresh random id, so items the source had copied between pages were no longer copies of each other in the duplicate: its page transitions faded them instead of gliding. Each now gets a copy id that keeps its root (lib/pageCopyId.ts, mirroring the app's page_copy_id.dart), unless the root is too long for the app to store a change under. 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 7 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 |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been 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.
"Duplicate strategy" on a cloud strategy gave every item and lineup in the copy a fresh random id. In a play animated across pages, an item and its copy on the next page are paired by the root their ids share (#267), so in the duplicate they no longer paired: every page turn faded them instead of gliding. This makes the duplicate keep those roots.
What changes
strategies:duplicategives each copied item and lineup id a copy id that keeps its root (<root>~cp1~<uuid>), instead of a plain uuid. Items that were copies of each other in the source are still copies of each other in the duplicate.convex/lib/pageCopyId.tsmirrors the app'spage_copy_id.dart: the same parser (only a mark followed by a canonical lowercase uuid counts as a copy) and the same no-nesting rule.Rollout
This is server-only, with no schema change, no protocol bump and no change to any function's arguments or results. Merging deploys it to production. Clients that predate #267 treat the new ids as ordinary strings: items in a duplicate fade there, as they do today.
Ground truth
Dev was running this code together with #267–#272.
gt-jett-h-01~cp1~ef3765a9…andgt-jett-h-01~cp1~27f9e82d…: one root, new ids. The second agent pairs the same way.Tests:
convex/pageCopyId.test.tscovers roots, look-alike ids, copies of copies, and the long-root fallback measured URL-encoded.convex/strategyDuplicate.test.tshas a new test: an agent copied between pages in the source gives two agents in the duplicate with the same root and new ids, and the image and lineup keep their roots too. The existing 27 duplicate tests still pass.npm run test:convex: all pass.npx tsc --noEmitpasses.ci: convex
🤖 Generated with Claude Code