typesense / firestore-typesense-search

Firebase Extension to automatically push Firestore documents to Typesense for full-text search with typo tolerance, faceting, and more
https://extensions.dev/extensions/typesense/firestore-typesense-search
Apache License 2.0
159 stars 35 forks source link

Warning on deleted documents #74

Closed junecv closed 10 months ago

junecv commented 10 months ago

Description

Warning of "Snapshot has no readTime. Using now()" appears for every document deleted on firebase.

Steps to reproduce

const targetValue = keysToDelete[i];
await productsCollectionRef.doc(targetValue).delete();

Expected Behavior

Complete without warning

Actual Behavior

Warning appears:

{
  "textPayload": "Snapshot has no readTime. Using now()",
  "insertId": "insertID",
  "resource": {
    "type": "cloud_function",
    "labels": {
      "region": "us-central1",
      "project_id": "abc",
      "function_name": "ext-firestore-typesense-search-indexToTypesenseOnFirestoreWrite"
    }
  },
  "timestamp": "2024-01-23T11:46:16.279665Z",
  "severity": "WARNING",
  "labels": {
    "runtime_version": "nodejs16_20240114_16_20_2_RC00",
    "execution_id": "executionID",
    "instance_id": "instanceID"
  },
  "logName": "projects/abc/logs/[cloudfunctions.googleapis.com](http://cloudfunctions.googleapis.com/)%2Fcloud-functions",
  "trace": "projects/abc/traces/traceID",
  "receiveTimestamp": "2024-01-23T11:46:16.538363409Z"
}

Metadata

Typesense Version: <1.2.0

OS: MacOS 14.2.1 (23C71)

jasonbosco commented 10 months ago

@junecv I've noticed this error in some my tests too.

I did some quick exploration on what this means and I found this StackOverflow answer which says this is expected when there are too many writes triggered in quick succession on the same document: https://stackoverflow.com/a/75908156/123545

Question for you: since this log line has a warning level, I wonder if it's non-critical? Do you see the actual changes reflected in Typesense, despite the error?

junecv commented 10 months ago

@jasonbosco I found the StackOverflow answer too before reaching out. In my case, the function is dedicated to delete a list of doc ID in Firestore. And the fact that each deletion (but not other read/write) has such warning makes me curious.

To your question, no, nothing wrong that I can see. Feel free to close the issue as you see appropriate.

jasonbosco commented 10 months ago

Glad to know that the delete does succeed in Typesense.

I'll close this issue for now, but in case someone stumbles on this issue in the future and has any additional thoughts / ideas, please feel free to post them in this thread.