We understand that firestore transaction is based on pessimistic lock (https://firebase.google.com/docs/firestore/manage-data/transactions), which means the actual update inside transaction block may success or fail based on "whether or not the document has been changed since last time I looked at it".
That being said, can we have a callback on the transaction.update()
and transaction.create()
(mutation) methods on success or failures so that we can do logging more accurately?
The reason I am asking this is, with pessimistic lock, two transaction blocks can happen simultaneously, and it may create a confusion in the logging when two mutually exclusive things seem to happen concurrently.