diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_transaction.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_transaction.dart index ec6391a8e52b..f031a0da68e7 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_transaction.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/lib/src/method_channel/method_channel_transaction.dart @@ -26,20 +26,11 @@ class MethodChannelTransaction extends TransactionPlatform { FirebaseFirestorePlatform.instanceFor(app: Firebase.app(appName)); } - int _documentGetCount = 0; - List> _commands = []; /// Returns all transaction commands for the current instance. - /// - /// All get operations must be written, otherwise an [AssertionError] will be thrown @override List> get commands { - if (_documentGetCount > 0) { - assert(_documentGetCount <= _commands.length, - "All transaction get operations must also be written."); - } - return _commands; } @@ -58,7 +49,6 @@ class MethodChannelTransaction extends TransactionPlatform { 'transactionId': _transactionId, 'reference': _firestore.doc(documentPath), }); - _documentGetCount++; return DocumentSnapshotPlatform( _firestore, diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/test/method_channel_tests/method_channel_transaction_test.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/test/method_channel_tests/method_channel_transaction_test.dart index 5062d205f495..71a9d54c665c 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/test/method_channel_tests/method_channel_transaction_test.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/test/method_channel_tests/method_channel_transaction_test.dart @@ -64,11 +64,6 @@ void main() { }); group('commands', () { - test('should throw if get is not written', () async { - await transaction.get(mockDocumentReference.path); - expect(() => transaction.commands, throwsAssertionError); - }); - test('returns with equal checks', () async { await transaction.get(mockDocumentReference.path); transaction.set(mockDocumentReference.path, {'foo': 'bar'});