最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

firebase - Firestore gRPC Listen does not send deletions - Stack Overflow

programmeradmin1浏览0评论

I am using Postman to call the firestore.googleapis gRPC Listen. I am using the web UI (/) to manually make changes to a Firestore for testing purposes. When I add a new document, I receive an appropriate document_change indicating this. However, when I delete a document, I do not receive a document_change or document_delete message at all. The count in the filter response message goes down accordingly based on how many documents I deleted, so it does appear that the deletion occurred and is recognized, but the I do not receive the change.

I am updating the resumeToken after each time I make a new request with the value from the CURRENT response for my targetId. I am deleting the documents after ending streaming and before making a new invoke and sending a new request. The procedure looks like this:

  1. Invoke Listen
  2. Send ListenRequest
  3. Inspect responses. Get the count from the filter response for my targetId. Get the resume token from the target_change response with CURRENT for my targetId.
  4. End streaming.
  5. On the web UI, delete a document.
  6. Invoke Listen.
  7. Send ListenRequest with count and resumeToken from #3.
  8. Inspect responses. Filter has a lower count for this target id. No document_change, document_delete, or document_remove received.

If relevant, I am using a bearer token to authenticate. Requests work fine and I can receive messages for new documents but not for deleted documents.

An example of my ListenRequest message:

Metadata: google-cloud-resource-prefix = projects/project1/databases/database1

{
    "database": "projects/project1/databases/database1",
    "add_target": {
        "target_id": 1,
        "resume_token": "CgkIzoO/uauyiwM=",
        "expected_count": {"value": 6},
        "query": {
            "parent": "projects/project1/databases/database1/documents",
            "structured_query": {
                "from": [
                    {
                        "collection_id": "TestCollection1",
                        "all_descendants": false
                    }
                ]
            }
        }
    },
    "once": false
}

Is my structured query incorrect? How can I write a query that includes all document changes, additions, or deletions? Or, is there another issue, such as a bug with Firestore?

发布评论

评论列表(0)

  1. 暂无评论