Skip to content

Conversation

@adamtheturtle
Copy link
Owner

@adamtheturtle adamtheturtle commented Nov 25, 2025

Note

Replaces custom block equivalence with standard equality, adding custom equality for file blocks that compares metadata and file content to support local-file URLs.

  • upload logic (src/_notion_scripts/upload.py):
    • Block matching: _find_last_matching_block_index now relies on standard == instead of a custom comparator.
    • File blocks equality: Introduces _file_blocks_match and _new_file_equality; monkey-patches __eq__ for Image, Video, Audio, and PDF blocks to compare metadata and SHA-256 of local file:// sources against existing Notion files.
    • Removes prior recursive equivalence logic for parent blocks, deferring to built-in equality.

Written by Cursor Bugbot for commit 45111ee. This will update automatically on new commits. Configure here.

return _files_match(
existing_file_url=other.file_info.url,
local_file_path=local_file_path,
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Type assertion only checks for UnoVideo, breaks other file blocks

The _file_blocks_match function asserts that other is specifically UnoVideo (line 140), but the function is designed to handle all four file block types (UnoImage, UnoVideo, UnoAudio, UnoPDF). This assertion will fail when comparing blocks of other file types, breaking equality checks for UnoImage, UnoAudio, and UnoPDF blocks.

Fix in Cursor Fix in Web

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.

2 participants