Skip to content

Firestore: fix watch against nested collections (issue #7515).#7613

Closed
Kyras wants to merge 1 commit intogoogleapis:masterfrom
Kyras:master
Closed

Firestore: fix watch against nested collections (issue #7515).#7613
Kyras wants to merge 1 commit intogoogleapis:masterfrom
Kyras:master

Conversation

@Kyras
Copy link

@Kyras Kyras commented Mar 29, 2019

Fix for issue mentioned in the issue #7515, by replacing the parent info of query target from the url to the root of the database, to actual query parent, stored in its parent info.

Collection query holds an _parent variable pointing to the Document/CollectionReference, which holds info about database path in the _parent_info(), which returns tuple containing:

  1. url to the parent object
  2. url to self

Thus, returning first value from _parent_info(), instead of url to root of database fixes the bug.

@Kyras Kyras requested a review from crwilcox as a code owner March 29, 2019 09:59
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 29, 2019
@tseaver tseaver changed the title Fixed issue #7515 Firestore: fix watch against nested collections (issue #7515). Mar 29, 2019
@tseaver tseaver added the api: firestore Issues related to the Firestore API. label Mar 29, 2019
Copy link
Contributor

@tseaver tseaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the patch! We need to add a unit test which actually exercises #7515 (creates a watch against a nested collection). The test should fail without this fix, and pass with it.

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 5, 2019
@tseaver
Copy link
Contributor

tseaver commented Apr 18, 2019

Superseded by #7752.

@tseaver tseaver closed this Apr 18, 2019
tseaver added a commit that referenced this pull request Apr 23, 2019
Avoids hard-coding the root document, to enable queries on nested
collections.

Closes #7515.
Supersedes #7613.
parthea pushed a commit that referenced this pull request Nov 24, 2025
Avoids hard-coding the root document, to enable queries on nested
collections.

Closes #7515.
Supersedes #7613.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: firestore Issues related to the Firestore API. cla: yes This human has signed the Contributor License Agreement. 🚨 This issue needs some love.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants