Skip to content

fix: prevent duplicate pages on upload retry#130

Open
yaniv-golan wants to merge 1 commit intovzhd1701:masterfrom
yaniv-golan:fix/duplicate-on-retry
Open

fix: prevent duplicate pages on upload retry#130
yaniv-golan wants to merge 1 commit intovzhd1701:masterfrom
yaniv-golan:fix/duplicate-on-retry

Conversation

@yaniv-golan
Copy link
Copy Markdown

Summary

  • Each upload retry was creating a new Notion page, leaving N duplicate [UNFINISHED UPLOAD] pages for N retry attempts
  • Extracted upload_note into focused functions: create_note_page, upload_note_blocks, remove_note_page, clear_page_children
  • Retry logic now reuses the same page across attempts, clearing children before each retry
  • On final failure, page title is reset to [UNFINISHED UPLOAD] and cleanup respects --keep-failed

Test plan

  • 14 new tests in tests/test_retry_dedup.py covering page reuse, child clearing, keep-failed behavior, DB mode, and cleanup failures
  • All existing tests updated and passing (219 total)
  • Manually verified with real ENEX import against Notion API

Each retry attempt was creating a new Notion page, leaving N duplicate
[UNFINISHED UPLOAD] pages. Now the page is created once and reused
across retries, with children cleared before each retry attempt.
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