Skip to content

Instantly share code, notes, and snippets.

@mcdonc
Created October 12, 2018 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcdonc/dfede0fbdba5f987727ee4afc75a35be to your computer and use it in GitHub Desktop.
Save mcdonc/dfede0fbdba5f987727ee4afc75a35be to your computer and use it in GitHub Desktop.
diff --git a/firestore/google/cloud/firestore_v1beta1/watch.py b/firestore/google/cloud/firestore_v1beta1/watch.py
index bc2b237bc1..a11313d6c3 100644
--- a/firestore/google/cloud/firestore_v1beta1/watch.py
+++ b/firestore/google/cloud/firestore_v1beta1/watch.py
@@ -619,10 +619,10 @@ class Watch(object):
assert name in updated_map, 'Document to delete does not exist'
old_document = updated_map.get(name)
# XXX probably should not expose IndexError when doc doesnt exist
- existing = updated_tree.find(old_document)
+ existing = updated_tree.find(name)
old_index = existing.index
# TODO: was existing.remove returning tree (presumably immuatable?)
- updated_tree = updated_tree.remove(old_document)
+ updated_tree = updated_tree.remove(name)
del updated_map[name]
return (DocumentChange(ChangeType.REMOVED,
old_document,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment