Skip to content

Fix Notion nested archive ordering - #135

Open
aseembits93 wants to merge 1 commit into
mainfrom
codex/notion-defer-block-archives-v2
Open

Fix Notion nested archive ordering#135
aseembits93 wants to merge 1 commit into
mainfrom
codex/notion-defer-block-archives-v2

Conversation

@aseembits93

@aseembits93 aseembits93 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • defer Notion block and entity archives until other writes complete
  • archive descendants before ancestors so writes beneath removed parents finish safely
  • undo nested archives ancestor-first by clearing in_trash on the original block IDs, preserving hierarchy, sibling order, children, and native block types
  • bump the durable journal component to v4 so older readers cannot apply the former lossy restoration behavior to new journals
  • add core, connector, store-migration, and mounted CLI regressions plus behavior documentation

Testing

  • cargo test -p locality-core -p locality-notion -p locality-store
  • CARGO_NET_GIT_FETCH_WITH_CLI=true cargo test -p loc-cli --test e2e_push_workflow (77 passed, 61 ignored credential-gated tests)
  • focused nested push/undo, in-place connector undo, and v1/v2/v3-to-v4 compatibility tests
  • changed targets pass Clippy with -D warnings after allowing unrelated baseline lints from the current Rust toolchain
  • cargo fmt --all -- --check
  • git diff --check
  • independent review completed with no findings

Review notes

The repository-wide strict Clippy command is blocked by pre-existing warnings outside this change; each changed target passes strict Clippy when those baseline lint classes are allowed.

Supersedes closed PR #133.

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
locality Ready Ready Preview Jul 30, 2026 12:00am

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codex review

No high-confidence issues found.

@aseembits93

Copy link
Copy Markdown
Collaborator Author

Addressed in d4411d6.

Notion block undo now restores the original block in place with {"in_trash": false} instead of appending a reconstructed replacement at the page root. Reversing the journaled descendant-first archive effects restores parent → child → grandchild, while retaining the original IDs, direct parents, sibling positions, descendants, and native block types. A purged/mismatched response fails closed.

I also added the requested parent/child/grandchild coverage at the core, connector, and mounted CLI workflow layers. The mounted workflow verifies both remote hierarchy/IDs and clean local reconciliation after undo. durable:journals is now v4 with a metadata-only v1/v2/v3 migration and minimum reader v4 so an older binary cannot use the prior lossy undo behavior on new journals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant