Skip to content

Commit

Permalink
An attempt at fixing #12168 by only returning the cached data at the …
Browse files Browse the repository at this point in the history
…child path rather than at the parent
  • Loading branch information
mortenbekditlevsen committed Dec 5, 2023
1 parent 5de0369 commit e78bef4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions FirebaseDatabase/Sources/Core/FSyncTree.m
Original file line number Diff line number Diff line change
Expand Up @@ -737,11 +737,12 @@ - (FIndexedNode *)persistenceServerCache:(FQuerySpec *)querySpec {
- (id<FNode>)getServerValue:(FQuerySpec *)query {
__block id<FNode> serverCacheNode = nil;
__block FSyncPoint *targetSyncPoint = nil;
__block FPath *relativePath = nil;
[self.syncPointTree
forEachOnPath:query.path
whileBlock:^BOOL(FPath *pathToSyncPoint, FSyncPoint *syncPoint) {
FPath *relativePath = [FPath relativePathFrom:pathToSyncPoint
to:query.path];
relativePath = [FPath relativePathFrom:pathToSyncPoint
to:query.path];
serverCacheNode =
[syncPoint completeEventCacheAtPath:relativePath];
targetSyncPoint = syncPoint;
Expand Down Expand Up @@ -772,7 +773,7 @@ - (FIndexedNode *)persistenceServerCache:(FQuerySpec *)querySpec {
getView:query
writesCache:[_pendingWriteTree childWritesForPath:[query path]]
serverCache:serverCache];
return [view completeEventCache];
return [view completeEventCacheFor: relativePath];
}

/**
Expand Down

0 comments on commit e78bef4

Please sign in to comment.