Skip to content

Fix Guid field deserialization in observable query delta reconstruction (#2173)#2176

Merged
einari merged 2 commits intomainfrom
fix/observable-query-guid-deserialization-regression
Apr 28, 2026
Merged

Fix Guid field deserialization in observable query delta reconstruction (#2173)#2176
einari merged 2 commits intomainfrom
fix/observable-query-guid-deserialization-regression

Conversation

@einari
Copy link
Copy Markdown
Contributor

@einari einari commented Apr 28, 2026

Fixed

Summary

Commit b52ecba introduced delta change-set optimization to reduce bandwidth by only sending items that were added, replaced, or removed since the last update. However, the change-set items were not being deserialized into typed model instances, causing Guid fields (and other strongly-typed fields) to remain as plain JSON objects and lose their methods.

This fix adds deserialization of all change-set items (added, replaced, removed) using JsonSerializer.deserializeArrayFromInstance before applying delta reconstruction in useObservableQuery, ensuring Guid fields are properly instantiated and methods like .equals() work correctly.

The fix includes a regression test that reproduces the exact failure scenario and ensures this issue doesn't regress in the future.

einari added 2 commits April 28, 2026 10:52
…a mode

This test reproduces the issue where Guid fields in observable query items
lose their methods (like .equals()) when reconstructed from change sets in
delta mode. The regression was introduced in commit b52ecba.
Commit b52ecba introduced delta change-set optimization to reduce bandwidth,
but did not deserialize changeSet items into typed model instances. This caused
Guid fields (and other strongly-typed fields) to remain as plain JSON objects,
losing their methods like .equals().

Solution: Deserialize all changeSet items (added, replaced, removed) using
JsonSerializer.deserializeArrayFromInstance before applying delta reconstruction.

This ensures Guid fields are properly instantiated as Guid class instances with
working methods, fixing downstream components like ChecklistValidation that
depend on Guid.equals().
@einari einari added the patch label Apr 28, 2026
@einari einari merged commit a48fd02 into main Apr 28, 2026
6 checks passed
@einari einari deleted the fix/observable-query-guid-deserialization-regression branch April 28, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant