Skip to content

Commit a5f4a38

Browse files
amabluea-maurice
authored andcommitted
Fixed an issue that could cause the local server cache on the client to become
corrupted. This did not affect data sent to the server, just the results that would be passed to listener callbacks. PiperOrigin-RevId: 274048350
1 parent aa34aae commit a5f4a38

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

database/src/desktop/view/view_processor.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,12 +415,13 @@ ViewCache ViewProcessor::ApplyServerOverwrite(
415415
// Apply the server overwrite to the appropriate child.
416416
Path child_change_path = change_path.PopFrontDirectory();
417417
// Get a copy of the child (if present) so that it can be mutated.
418-
Variant new_child_node = old_server_snap.variant();
418+
Variant new_child_node =
419+
VariantGetChild(&old_server_snap.variant(), child_key);
419420
VariantUpdateChild(&new_child_node, child_change_path, changed_snap);
420421
if (IsPriorityKey(child_key.str())) {
421422
// If this is a priority node, update the priority on the indexed node.
422-
new_server_cache = server_filter->UpdatePriority(
423-
old_server_snap.indexed_variant(), new_child_node);
423+
new_server_cache =
424+
server_filter->UpdatePriority(new_server_cache, new_child_node);
424425
} else {
425426
// If this is a regular update, the update through the filter to make sure
426427
// we get only the values that are not filtered by the query spec.

0 commit comments

Comments
 (0)