Skip to content

fix: add defensive check for undefined uuid in uuidToId#703

Open
ehredev wants to merge 2 commits intoNotionX:masterfrom
ehredev:fix/uuid-to-id-defensive-check
Open

fix: add defensive check for undefined uuid in uuidToId#703
ehredev wants to merge 2 commits intoNotionX:masterfrom
ehredev:fix/uuid-to-id-defensive-check

Conversation

@ehredev
Copy link
Copy Markdown

@ehredev ehredev commented Apr 2, 2026

Notion API response structure changes can cause block IDs to be undefined in some cases, leading to undefined.replaceAll() errors.

Description

uuidToId could crash with undefined.replaceAll() when Notion API returns blocks with undefined IDs due to their recent response structure changes. Added a simple fallback (uuid || '') to prevent the error.

Notion API response structure changes can cause block IDs to be
undefined in some cases, leading to `undefined.replaceAll()` errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

Someone is attempting to deploy a commit to the Saasify Team on Vercel.

A member of the Team first needs to authorize it.

@ehredev ehredev changed the title fix: add defensive check for undefined uuid in uuidToId(#702) fix: add defensive check for undefined uuid in uuidToId Apr 2, 2026
@ehredev
Copy link
Copy Markdown
Author

ehredev commented Apr 2, 2026

This issue is regarding #702

Notion API now returns some blocks with a doubly-nested structure:
{ role, value: { role, value: { id, type, ... } } }
Flatten these right after receiving the recordMap so downstream code
can access block properties directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ButzkeGWG
Copy link
Copy Markdown

upgrade my notion libraries to the latest one solved the problem

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