Add backward-compatibility migrations for legacy field names#52
Closed
leoafarias wants to merge 2 commits intorelease/nextfrom
Closed
Add backward-compatibility migrations for legacy field names#52leoafarias wants to merge 2 commits intorelease/nextfrom
leoafarias wants to merge 2 commits intorelease/nextfrom
Conversation
- 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
|
To view this pull requests documentation preview, visit the following URL: Documentation is deployed and generated using docs.page. |
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.fromMap()now migrates legacycommentsfield tonotes, withnotestaking precedence if both are presentBlock.fromMap()now normalizes legacytype: "column"toContentBlock.keyto prevent deserialization failuresImplementation Details
notesfield is preferred overcommentswhen both exist, preventing accidental overwritescolumntype is normalized to the currentblocktype identifier to maintain compatibility with old serialized datahttps://claude.ai/code/session_01M5vK9CQpK7959EHJtvPbKU