overengineeringstudio / overengineeringstudio/effect-utils
notion-react: relocating a cached <ChildPage> under a brand-new parent recreates it instead of moving
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 82
- Forks
- 2
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 121
Description
Problem
The cross-parent move detection (pagesByKey + movePage) only runs inside diffChildren recursions over existing scopes. When a cached <ChildPage> is relocated under a brand-new parent (new page, toggle, or column), the new subtree is built by emitAppendsForNew / inlinePackChildren, which tail a fresh createPage for every page-kind candidate without consulting the cache. The old location then emits archivePage (the move is also not pre-claimed, since collectPreClaimedMoves does not descend into unretained candidates).
Net effect: the page identity churns (archive + recreate), server-side content is duplicated transiently, and any checkpointed pending state from #1100 is adopted but then discarded.
Repro sketch
- Warm sync
<Page><A/><ChildPage k="c"/></Page>. - Re-sync with
<Page><A/><Toggle><ChildPage k="c"/></Toggle></Page>(toggle is new). - Observe
createPage(c)+archivePage(c-old)instead ofmovePage(c → toggle).
Suggested direction
- Teach
emitAppendsForNewand theinlinePackChildrentail path to emitmovePage(parent = tmp id, resolved at apply time) when a page-kind candidate's key exists inpagesByKey. - Extend
collectPreClaimedMovesto recurse into unretained candidate subtrees so the outgoing parent skips the archive. - Recurse content reconciliation into
moveSource.childrenvs the candidate subtree after the move.
Related: #1100 (pending page-create checkpoints) — its adoption now runs before cross-parent matching, so this gap is the remaining convergence hole for relocated pages.
Posted on behalf of @schickling
| field | value |
|---|---|
agent_identity |
unknown |
agent_persona |
generalist |
agent_supervisor |
unavailable |
agent_tool |
OMP |
agent_tool_version |
18.0.3 |
agent_runtime |
OMP 18.0.3 |
tooling_profile |
dotfiles@f33cd9c-dirty |
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with emitAppendsForNew, the inlinePackChildren tail path, and collectPreClaimedMoves, then trace pagesByKey and movePage through the existing diffChildren logic. Reproduce the new-parent Toggle case described in the issue and inspect how moveSource.children is reconciled. Done means the cached page uses movePage, the old location skips archivePage, and the page is not recreated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100