Hi <@U01NZ4D0LDD> Doesn't the extension on firebas...
# community-help
s
Hi @Jason Bosco Doesn't the extension on firebase have onDeleted cloud function to delete documents in Typesense?
f
It listens to any write,
onDocumentWritten
. That includes deletions as well
s
Ok I got it. I just checked the log in that function, and I saw a deleted document in firestore was being called typesense api to delete, but it is still existing in typesense. Why is this case happening?
@Jason Bosco @Fanis Tharropoulos do you know why typesense cannot delete a document when indexOnWrite has been triggered?
f
It exists on Typesense but not on Firestore?
Can you trigger the
backfill
function?
s
@Fanis Tharropoulos I did triggered the backfill function and it exported all firestore documents into typesense. I created a document with id = backfill in a collection named typesense-sync
j
Could you expand the log line in the Firebase extension logs and share a screenshot of it?
s
here you are
@Jason Bosco could you check the logs?
j
Could you expand that log line fully (press the little arrow) on the left.
s
Here you are @Jason Bosco
j
Looking at the cluster logs on our side, I do see that delete request came into the cluster at exactly the same timestamp in your screenshot. I also don't see that document ID in your cluster (with cluster ID
gqj...
), so from what I can tell the document was deleted.
I wonder if what you're observing is the delay between when a delete happens in Firebase and when it actually gets sent over to Typesense by Firebase. The sync is not immediate, so you want to plan for eventually consistent reads
s
the document is still existing in typesense. anw, where can I find the logs in the cluster?
j
We don’t expose the logs since usually it’s only meant for internal debugging. The screenshot says that’s the uid field. Could you also share the id field of the same document in your screenshot?
s
@Jason Bosco uid = id
hi @Jason Bosco
j
Could you confirm if your Cluster ID starts with
gqj...
? May be we're looking at different clusters, because when I checked in the team account under your email address, I don't see this document
s
yes it starts with gqj... and ends with ...ifp
@Jason Bosco what next?
j
Could you give me a copy-pastable version of the document ID?
May be I'm confusing the
I
and
l
for eg in the picture
Copy code
curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}"       "<https://gqj>....<http://a1.typesense.net/collections/users/documents/uXi6MUVF5ХOXWuHPAYcPDlKR9Fr2|a1.typesense.net/collections/users/documents/uXi6MUVF5ХOXWuHPAYcPDlKR9Fr2>"
{"message": "Could not find a document with id: uXi6MUVF5ХOXWuHPAYcPDlKR9Fr2"}
Could you try running that with the correct document ID that you copy-paste from Firestore directly
s
uXi6MUVF5XOXWuHPAYcPDlKR9Fr2 here you are
@Jason Bosco can you check today?
j
Ok I see the document the document now on the Typesense side. Do you still see it in Firestore on your side? Or has that also been deleted?
Separately, can you create a new test document in Firestore with a special set of values that we can use to easily identify the record, wait for it to show up in Typesense. And then delete it and see if that simple case works?
One suspicion I have is that your cluster is using a little bit of swap, so this is a sign that there was memory pressure on it at some point, so may be a write was rejected
In either case, I would still recommend upgrading your RAM to the next tier
s
@Jason Bosco it's still in firestore
j
Wait, if it's still in Firestore then it should also exist in Typesense by definition right (because the extension would have synced it over)? I'm a little confused now!
s
sorry, I was wrong. It's deleted by user