Skip to content

fix: handle nested value format in _update_user_info - #408

Open
hambergerpls wants to merge 1 commit into
jamalex:masterfrom
hambergerpls:fix/nested-value-user-root
Open

hambergerpls wants to merge 1 commit into
jamalex:masterfrom
hambergerpls:fix/nested-value-user-root

Conversation

@hambergerpls

Copy link
Copy Markdown

Summary

  • Fixes KeyError: 'space_view_pointers' in _update_user_info caused by Notion's API nesting format change
  • Extracts a reusable _unwrap_record_value static method that handles both old and new record formats
  • Uses .get() with defaults throughout to avoid hard crashes on missing keys

Closes #407

Notion's internal API now wraps record values in an extra nesting layer:
  {"value": {"value": {...data}, "role": "editor"}}
instead of the previous flat format:
  {"value": {...data}, "role": "editor"}

store_recordmap in store.py already handles this, but _update_user_info
accessed the raw records dict before store_recordmap, hitting the old
single-level assumption on the space_view_pointers lookup.

Extract a reusable _unwrap_record_value helper and use it to safely
resolve space_view_pointers regardless of nesting depth.

Fixes jamalex#407
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.

KeyError: 'space_view_pointers' in _update_user_info — Notion API nesting format change

1 participant