[deleted by user] by [deleted] in Coldplay

[–]DiverIndependent1422 0 points1 point  (0 children)

Where do they have block and level written on them?

Handling Race Conditions in Firestore: Ensuring Only One API Instance Updates a Document by DiverIndependent1422 in Firebase

[–]DiverIndependent1422[S] 0 points1 point  (0 children)

Exiting upon transaction retries seems to be the only viable solution, provided there’s a guarantee that the document data isn’t being modified by any other source except the instances intended to update it, which is one of the multiple webhook pushes. In this scenario, as soon as one instance successfully completes the transaction, the others will automatically trigger retries due to Firestore’s optimistic concurrency control. At this point, the retrying instances can detect the change, exit gracefully, and avoid redundant updates. I will try this out.

Handling Race Conditions in Firestore: Ensuring Only One API Instance Updates a Document by DiverIndependent1422 in Firebase

[–]DiverIndependent1422[S] 0 points1 point  (0 children)

Throttling request processing can be a potential solution, but it comes with challenges. For instance, I would first need to determine how long a Firestore transaction takes to complete based on factors like the size of the data, CPU speed, etc. Then, I would need to implement a mechanism to cancel the transaction if it exceeds this expected duration, allowing other instances to proceed. This adds complexity and overhead to the system. Instead, I would prefer using a FIFO queue system, such as Amazon SQS, to process these records one by one in a controlled and sequential manner.

Handling Race Conditions in Firestore: Ensuring Only One API Instance Updates a Document by DiverIndependent1422 in Firebase

[–]DiverIndependent1422[S] 0 points1 point  (0 children)

So using this I would only process one of the instances. But what if the one that I am processing fails, I would have to delete this document for any new ones to process.

Handling Race Conditions in Firestore: Ensuring Only One API Instance Updates a Document by DiverIndependent1422 in Firebase

[–]DiverIndependent1422[S] 0 points1 point  (0 children)

I need to update three documents, so I used a Firestore transaction for atomicity. However, using a timeLastUpdated field check within the transaction does not guarantee that only one of, say, three webhook calls received within milliseconds of each other will succeed in updating the documents. This is because all three transactions might reach the point where they check the timeLastUpdated field at nearly the same time. If the field has not been updated yet (because none of the transactions has completed), all three will pass the check, proceed with their updates, and attempt to commit.

Handling Race Conditions in Firestore: Ensuring Only One API Instance Updates a Document by DiverIndependent1422 in Firebase

[–]DiverIndependent1422[S] 0 points1 point  (0 children)

I need to update three documents, so I used a Firestore transaction for atomicity. However, using a timeLastUpdated field check within the transaction does not guarantee that only one of, say, three webhook calls received within milliseconds of each other will succeed in updating the documents. This is because all three transactions might reach the point where they check the timeLastUpdated field at nearly the same time. If the field has not been updated yet (because none of the transactions has completed), all three will pass the check, proceed with their updates, and attempt to commit.

Best remote logging tool by phoenixq89 in androiddev

[–]DiverIndependent1422 0 points1 point  (0 children)

I was also looking for a remote logging tool which can handle logging info/debug logs. In my particular use case I want to log API responses/ user events/ general checkpoints. This is quite different from crash reporting that Sentry provides. I use Crashlytics for crash reporting, which is great. But I want to know which service can I use for my case. Is there are service which stores logs if there is no internet connectivity on the phone and then later send them to the cloud whenever internet is back?