Complete fix: Deserialize observable query response data for all transfer modes (#2173)#2177
Merged
Merged
Conversation
…odes The previous delta-only fix was incomplete. The root cause affects ALL responses: - Initial/full data responses (standard mode) - Delta mode responses with full data fallback - All modes where response.data needs model deserialization The issue: response.data arrives as plain JSON objects from the server and was never being deserialized into model instances with @field decorators applied. This caused Guid fields and other strongly-typed fields to remain as plain objects without their methods (e.g., Guid.equals()), breaking downstream code. Solution: Deserialize ALL response.data using JsonSerializer.deserializeFromInstance() whenever the observable query has a modelType, covering all code paths: 1. Initial response with full data 2. Subsequent full-data responses (non-delta mode) 3. Delta mode fallback when no previous result exists This ensures Guid and other typed fields are properly instantiated regardless of transfer mode or response path.
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.
Fixed
Summary
The initial fix (PR #2176) only addressed delta mode changeSet deserialization, but the root cause affects all observable query responses, not just delta updates.
The Problem
When observable query responses arrive from the server, the data is transmitted as plain JSON objects. The code was never deserializing this data into model instances with their
@fielddecorators applied. This caused:.equals()methodRoot Cause
The issue exists in ALL response paths:
QueryResultWithState.fromQueryResult()just passes data through without deserializingThe Fix
Added
deserializeResponseData()function that:JsonSerializer.deserializeArrayFromInstance()to instantiate all items with proper typesNow all response data, regardless of transfer mode, is properly instantiated with
@fielddecorators applied and methods available.Testing