fix: prevent writing to nonexistent firestore docs
Using the same livekit project means we may receive events for another environment, though we should eventually separate the environments.
This commit is contained in:
@@ -1132,7 +1132,7 @@ func (h *Handler) HandleLivekitWebhook(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
_, err = docRef.Update(ctx, []firestore.Update{
|
||||
{Path: "huddle_active_participants", Value: participantIds},
|
||||
})
|
||||
}, firestore.Exists)
|
||||
if err != nil {
|
||||
slog.Error("failed to update huddle participants in firestore", "error", err, "path", docPath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user