Skip to content

Add backward-compatibility migrations for legacy field names#52

Closed
leoafarias wants to merge 2 commits intorelease/nextfrom
claude/general-session-jBtv7
Closed

Add backward-compatibility migrations for legacy field names#52
leoafarias wants to merge 2 commits intorelease/nextfrom
claude/general-session-jBtv7

Conversation

@leoafarias
Copy link
Collaborator

Summary

This PR implements backward-compatibility fixes to prevent data loss and runtime crashes when deserializing legacy JSON payloads. Two migration paths are added to normalize old field/type names to their current equivalents.

Key Changes

  • Slide model: Slide.fromMap() now migrates legacy comments field to notes, with notes taking precedence if both are present
  • Block model: Block.fromMap() now normalizes legacy type: "column" to ContentBlock.key to prevent deserialization failures
  • Tests: Added 3 regression tests covering legacy comments migration, notes precedence, and legacy column type normalization

Implementation Details

  • Migration logic is applied in factory constructors before passing to generated mappers, ensuring normalization happens transparently
  • Precedence is explicit: notes field is preferred over comments when both exist, preventing accidental overwrites
  • Legacy column type is normalized to the current block type identifier to maintain compatibility with old serialized data
  • All 709 core tests pass (3 new + 706 existing)

https://claude.ai/code/session_01M5vK9CQpK7959EHJtvPbKU

claude added 2 commits March 10, 2026 00:10
- Migrate legacy 'comments' field to 'notes' in Slide.fromMap() to
  prevent silent data loss when deserializing old JSON payloads.
- Normalize legacy 'column' block type to 'block' (ContentBlock) in
  Block.fromMap() to prevent runtime crashes on old serialized data.
- Add regression tests for both migration paths.

https://claude.ai/code/session_01M5vK9CQpK7959EHJtvPbKU
@docs-page
Copy link

docs-page bot commented Mar 10, 2026

To view this pull requests documentation preview, visit the following URL:

docs.page/btwld/superdeck~52

Documentation is deployed and generated using docs.page.

@leoafarias leoafarias closed this Mar 10, 2026
@leoafarias leoafarias deleted the claude/general-session-jBtv7 branch March 10, 2026 00:15
@github-actions
Copy link

Visit the preview URL for this PR (updated for commit ce239d7):

https://superdeck-dev--pr52-claude-general-sessi-7ack5syd.web.app

(expires Thu, 09 Apr 2026 00:21:00 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bd68fc230762285849207e7e120aaf87cd4ca2f9

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