Skip to content

[claude] Fix sync crash on legacy snapshots when the CRDT has no morph types - #3001

Merged
myieye merged 2 commits into
developfrom
claude/morph-type-legacy-snapshot
Nov 19, 2026
Merged

myieye merged 2 commits into
developfrom
claude/morph-type-legacy-snapshot

Conversation

@myieye

@myieye myieye commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

[Claude, autonomous]

A snapshot from before morph-type support deserializes MorphTypes as null, and since #2483 a CRDT can have no morph types, so the legacy patch left it null and MorphTypeSync threw. Null now becomes [], so FwData's morph types are added to the CRDT. Also makes SyncTests cleanup skip CRDT entries when the shared CRDT has no vernacular writing system, so tests that don't sync into it stop failing when run alone.

🤖 Generated with Claude Code

A snapshot written before morph-type support deserializes MorphTypes as
null. The legacy patch only replaced it when the CRDT had morph types,
and since #2483 stopped seeding them on open a CRDT can have none, so
MorphTypeSync threw a NullReferenceException. Treat null as empty so
FwData's morph types get added to the CRDT.

Also make SyncTests cleanup skip CRDT entries when the shared CRDT has no
vernacular writing system, so tests that don't sync into it no longer
fail when run alone or first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

For a non-null snapshot with null or empty MorphTypes, the service now assigns the CRDT’s current morph types, even when that list is empty. A new integration test checks synchronization of a legacy snapshot with null MorphTypes. It verifies that FieldWorks morph types are populated, the CRDT matches them, and synchronization reports zero FieldWorks changes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • Issue 2869: The reported null MorphTypes and empty CRDT case matches the scenario covered by the new integration test.

Suggested reviewers: rmunn, hahn-kev

Merge Risk: Minimal · up to d6afc

This change prevents sync crashes when a legacy snapshot has null morph types. No specific merge-blocking risk was found. The new integration test covers the legacy snapshot case.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main fix: sync crash on legacy snapshots when the CRDT has no morph types. The summary shows the service now replaces null or empty MorphTypes with the CRDT's morph types, and the …
Description check Passed The description states the cause (legacy snapshots deserialize MorphTypes as null, and the CRDT can have no morph types), the fix (null becomes an empty list so FwData morph types are added), and the …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main fix: sync crash on legacy snapshots when the CRDT has no morph types. The summary shows the service now replaces null or empty MorphTypes with the CRDT's morph types, and the description says null becomes an empty list so FwData morph types are added. The title matches the primary change.

Full details: Description check

Explanation

The description states the cause (legacy snapshots deserialize MorphTypes as null, and the CRDT can have no morph types), the fix (null becomes an empty list so FwData morph types are added), and the SyncTests cleanup change that skips CRDT entries when the CRDT has no vernacular writing system. These match the raw summary and objectives.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the morph types with care,
A legacy snapshot brings null to the lair.
The CRDT starts with an empty list,
FieldWorks fills in what the sync had missed.
The bunny hops on, its checklist complete.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 20a22125-49b1-414e-91d7-104d5a2aec1b
Commits

Reviewing files that changed from the base of the PR and between e82558e and d6afc0f.

Files selected for processing: 2

  • backend/FwLite/FwLiteProjectSync.Tests/SyncTests.cs
  • backend/FwLite/FwLiteProjectSync/CrdtFwdataProjectSyncService.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions github-actions Bot added the 🔩 FW Lite Core Shared MiniLcm, CRDT and sync libraries that ship in both FW Lite and FwHeadless label Nov 18, 2026
@argos-ci

argos-ci Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
e2e (Inspect) ✅ No changes detected - Nov 19, 2026, 7:33 AM

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@myieye
myieye merged commit 8c5c3af into develop Nov 19, 2026
25 checks passed
@myieye
myieye deleted the claude/morph-type-legacy-snapshot branch November 19, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔩 FW Lite Core Shared MiniLcm, CRDT and sync libraries that ship in both FW Lite and FwHeadless

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants