I referred the example here to filter out duplicate events. I see that the event id contains =
as well as /
characters. Are the event id base64 encoded? This is creating issues at times as the document path becomes nested collection if a slash /
is found in the id. But to my surprise I was not able to base64 decode them.
For example- 2 id which I could track are – LJ79W2cT0inTJbzFEHH/Aw3i10M=
and IQUaGYPQpdYZw3mT3dHRca/Q7tU=
.
2
Answers
I don’t think there’s any definition of what an event ID in Cloud Functions looks like. You should treat them as opaque strings and not make any assumptions on their contents or the meaning of their contents beyond that if you get the same event ID multiple times, they represent the same event.
You can’t use a Trigger’s EventId as document ID directly, since it can contain forward slashes.
You should remove the slashes first: