diff --git a/packages/firestore/e2e/Transaction.e2e.js b/packages/firestore/e2e/Transaction.e2e.js index cb49d5cb..ba013e76 100644 --- a/packages/firestore/e2e/Transaction.e2e.js +++ b/packages/firestore/e2e/Transaction.e2e.js @@ -86,22 +86,6 @@ describe('firestore.Transaction', () => { } }); - it('should throw if get command is called with no writes', async () => { - const docRef = firebase.firestore().doc('v6/foo'); - - try { - await firebase.firestore().runTransaction(t => { - return t.get(docRef); - }); - return Promise.reject(new Error('Did not throw an Error.')); - } catch (error) { - error.message.should.containEql( - 'Every document read in a transaction must also be written', - ); - return Promise.resolve(); - } - }); - it('should get a document and return a DocumentSnapshot', async () => { const docRef = firebase.firestore().doc('v6/transactions/transaction/get-delete'); await docRef.set({}); diff --git a/packages/firestore/lib/FirestoreTransactionHandler.js b/packages/firestore/lib/FirestoreTransactionHandler.js index 305337b8..82bead23 100644 --- a/packages/firestore/lib/FirestoreTransactionHandler.js +++ b/packages/firestore/lib/FirestoreTransactionHandler.js @@ -99,17 +99,6 @@ export default class FirestoreTransactionHandler { // native emits that the transaction is final transaction._pendingResult = pendingResult; - if ( - transaction._calledGetCount > 0 && - transaction._calledGetCount !== transaction._commandBuffer.length - ) { - return meta.reject( - new Error( - 'firebase.firestore().runTransaction() Every document read in a transaction must also be written.', - ), - ); - } - // send the buffered update/set/delete commands for native to process return this._firestore.native.transactionApplyBuffer(id, transaction._commandBuffer); }