Skip to content

Firestore runTransaction transaction.get does not work #18870

@creativecreatorormaybenot

Description

I am using the scenario for running a transaction from the example:

final DocumentReference postRef = Firestore.instance.document('posts/123');
Firestore.instance.runTransaction((Transaction tx) async {
  DocumentSnapshot postSnapshot = await tx.get(postRef);
  if (postSnapshot.exists) {
    await tx.update(postRef, <String, dynamic>{'likesCount': postSnapshot.data['likesCount'] + 1});
  }
});

It worked for me before, but not now, apparently:

DocumentSnapshot postSnapshot = await tx.get(postRef);

This instantly fails with a PlatformException , its message: Timed out waiting for task.

  • Flutter version: 0.5.4
  • cloud_firestore: 0.7.3

Metadata

Metadata

Assignees

Labels

c: crashStack traces logged to the consolep: cloud_firestoreObsolete - Firebase Firestore pluginp: firebaseObsolete - Firebase pluginspackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions