Flutter app crashes on concurrent transactions performed on cloud Firestore
问题 I am trying to develop an app where multiple users log in and completes a poll concurrently. In this, as soon as user submits the answer the transaction is ran to increment the counter for given answer try { DocumentSnapshot freshsnap = await tx.get(reff); try { await tx.update(reff, <String, dynamic>{ '$i': freshsnap['$i'] + 1, }); } catch (error) { print("Error" + error.code); } } catch (error) { if (error is PlatformException && error.code == 'Error performing transaction') { // await tx