{"action":"created","issue":{"url":"https://api.github.com/repos/flutter/flutter/issues/18747","repository_url":"https://api.github.com/repos/flutter/flutter","labels_url":"https://api.github.com/repos/flutter/flutter/issues/18747/labels{/name}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/18747/comments","events_url":"https://api.github.com/repos/flutter/flutter/issues/18747/events","html_url":"https://github.com/flutter/flutter/issues/18747","id":335071200,"node_id":"MDU6SXNzdWUzMzUwNzEyMDA=","number":18747,"title":"Firestore transaction fails with 'Transaction failed all retries'","user":{"login":"dmjones","id":3658671,"node_id":"MDQ6VXNlcjM2NTg2NzE=","avatar_url":"https://avatars1.githubusercontent.com/u/3658671?v=4","gravatar_id":"","url":"https://api.github.com/users/dmjones","html_url":"https://github.com/dmjones","followers_url":"https://api.github.com/users/dmjones/followers","following_url":"https://api.github.com/users/dmjones/following{/other_user}","gists_url":"https://api.github.com/users/dmjones/gists{/gist_id}","starred_url":"https://api.github.com/users/dmjones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmjones/subscriptions","organizations_url":"https://api.github.com/users/dmjones/orgs","repos_url":"https://api.github.com/users/dmjones/repos","events_url":"https://api.github.com/users/dmjones/events{/privacy}","received_events_url":"https://api.github.com/users/dmjones/received_events","type":"User","site_admin":false},"labels":[{"id":379784845,"node_id":"MDU6TGFiZWwzNzk3ODQ4NDU=","url":"https://api.github.com/repos/flutter/flutter/labels/p:%20firebase","name":"p: firebase","color":"fbca04","default":false},{"id":527275775,"node_id":"MDU6TGFiZWw1MjcyNzU3NzU=","url":"https://api.github.com/repos/flutter/flutter/labels/p:%20first%20party","name":"p: first party","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-23T05:39:33Z","updated_at":"2018-06-30T15:05:41Z","closed_at":null,"author_association":"NONE","body":"## Steps to Reproduce\r\n\r\nTrying to run a very simple transaction, similar to the example in the cloud_firestore documentation (using v0.7.3):\r\n\r\n```dart\r\n    DocumentReference usernameDocRef =\r\n        Firestore.instance.collection(_USERNAMES).document(username);\r\n\r\n    await Firestore.instance.runTransaction((transaction) async {\r\n      var snapshot = await transaction.get(usernameDocRef);\r\n      if (!snapshot.exists) {\r\n        await transaction.set(usernameDocRef, {\r\n          _UsernamesKey.userid: _user.id,\r\n        });\r\n      }\r\n    });\r\n```\r\n\r\n## Logs\r\n\r\n```\r\n[+9301 ms] [VERBOSE-2:dart_error.cc(16)] Unhandled exception:\r\n[        ] PlatformException(9, Transaction failed all retries., null)\r\n[        ] #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:547:7)\r\n[        ] #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:279:18)\r\n[        ] <asynchronous suspension>\r\n[        ] #2      Firestore.runTransaction (file:///Users/duncan/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.3/lib/src/firestore.dart:115:10)\r\n[        ] <asynchronous suspension>\r\n[        ] #3      FirebaseDataService.updateUsername (package:project/service/firebase_data_service.dart:308:30)\r\n[        ] <asynchronous suspension>\r\n[        ] #4      UsernamePresenter.usernameChosen (package: project/registration/username_presenter.dart:17:39)\r\n[        ] <asynchronous suspension>\r\n[        ] #5      _UsernameSelectionView.build.<anonymous closure> (package: project/registration/username_view.dart:64:43)\r\n[        ] #6      OnePressButtonState._pressed (package: project/shared.dart:171:14)\r\n[        ] #7      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:494:14)\r\n[        ] #8      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:549:30)\r\n[        ] #9      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)\r\n[        ] #10     TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:161:9)\r\n[        ] #11     TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:94:7)\r\n[        ] #12     PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:315:9)\r\n[        ] #13     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12)\r\n[        ] #14     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11)\r\n[        ] #15     _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:19)\r\n[        ] #16     _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121:22)\r\n[        ] #17     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:101:7)\r\n[        ] #18     _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:64:7)\r\n[        ] #19     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:48:7)\r\n[        ] #20     _invoke1 (dart:ui/hooks.dart:134:13)\r\n[        ] #21     _dispatchPointerDataPacket (dart:ui/hooks.dart:91:5)\r\n```\r\n\r\n<!--\r\n     Run `flutter analyze` and attach any output of that command below.\r\n     If there are any analysis errors, try resolving them before filing this issue.\r\n-->\r\n\r\n```\r\n```\r\n\r\n<!-- Finally, paste the output of running `flutter doctor -v` here. -->\r\n\r\n```\r\nflutter doctor -v\r\n[✓] Flutter (Channel dev, v0.5.5, on Mac OS X 10.13.4 17E202, locale en-GB)\r\n    • Flutter version 0.5.5 at /Users/duncan/git/flutter\r\n    • Framework revision 020e0ef55c (8 days ago), 2018-06-14 13:17:08 -0700\r\n    • Engine revision c3976b3c71\r\n    • Dart version 2.0.0-dev.61.0.flutter-c95617b19c\r\n\r\n[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)\r\n    • Android SDK at /Users/duncan/Library/Android/sdk\r\n    • Android NDK location not configured (optional; useful for native profiling support)\r\n    • Platform android-27, build-tools 27.0.3\r\n    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java\r\n    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)\r\n    • All Android licenses accepted.\r\n\r\n[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)\r\n    • Xcode at /Applications/Xcode.app/Contents/Developer\r\n    • Xcode 9.4.1, Build version 9F2000\r\n    • ios-deploy 1.9.2\r\n    • CocoaPods version 1.5.2\r\n\r\n[✓] Android Studio (version 3.1)\r\n    • Android Studio at /Applications/Android Studio.app/Contents\r\n    • Flutter plugin version 25.0.1\r\n    • Dart plugin version 173.4700\r\n    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)\r\n\r\n[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.2)\r\n    • IntelliJ at /Applications/IntelliJ IDEA.app\r\n    • Flutter plugin version 25.0.2\r\n    • Dart plugin version 181.4668.60\r\n\r\n[✓] Connected devices (1 available)\r\n    • duncan_iphone • - • ios • iOS 11.4\r\n\r\n• No issues found!\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/flutter/flutter/issues/comments/401546689","html_url":"https://github.com/flutter/flutter/issues/18747#issuecomment-401546689","issue_url":"https://api.github.com/repos/flutter/flutter/issues/18747","id":401546689,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTU0NjY4OQ==","user":{"login":"Olb","id":1109390,"node_id":"MDQ6VXNlcjExMDkzOTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1109390?v=4","gravatar_id":"","url":"https://api.github.com/users/Olb","html_url":"https://github.com/Olb","followers_url":"https://api.github.com/users/Olb/followers","following_url":"https://api.github.com/users/Olb/following{/other_user}","gists_url":"https://api.github.com/users/Olb/gists{/gist_id}","starred_url":"https://api.github.com/users/Olb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Olb/subscriptions","organizations_url":"https://api.github.com/users/Olb/orgs","repos_url":"https://api.github.com/users/Olb/repos","events_url":"https://api.github.com/users/Olb/events{/privacy}","received_events_url":"https://api.github.com/users/Olb/received_events","type":"User","site_admin":false},"created_at":"2018-06-30T15:05:41Z","updated_at":"2018-06-30T15:05:41Z","author_association":"NONE","body":"I have this problem only on iOS device or simulator but on Android everything works as expected."}}
{"actor":{"display_login":"Olb"}}