-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Since we are using Firebase Cloud Functions and Triggers, this has a consequence when we want to delete many entries in Firebase after transferring results to postgres. The effect of this is, that after the data has been stored in postgres, the delete in firebase fails. Consequently, we'll try to import the very same data from firebase in our next iteration. More information on limits of firebase database here: https://firebase.google.com/docs/database/usage/limits
We need to find a way to delete the data in firebase properly, once all results have been transferred to postgres.
we need to thing about either limit the number of groups that should be transferred (and deleted later). E.g. as described here: https://firebase.google.com/docs/database/admin/retrieve-data#limit-queries
Or we use a different type of triggers. For example such as onCreate
or onUpdate
instead of OnWrite
. E.g. as described here: https://firebase.google.com/docs/functions/database-events
When trying to delete the entries in firebase we get the following response:
412 Precondition Failed | The request's specified ETag value in the if-match header did not match the server's value. |
---|
This is due to the fact, that the insert took so long, and the REST api connection has been resetting, and firebase is in a new state then.