Conversation
🦋 Changeset detectedLatest commit: d93d965 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
There was a problem hiding this comment.
LGTM. Just two very minor comments!
|
|
||
| if (retryCounter === 1) { | ||
| expect(snap1.exists()).to.be.false; | ||
| // On the first attemp, create a doc before transaction.set(), so that |
There was a problem hiding this comment.
nit: "attemp" -> "attempt"
| transaction.set(docRef, { count: 2 }); | ||
| }); | ||
| expect(retryCounter).to.equal(2); | ||
| const result = await getDoc(docRef); |
There was a problem hiding this comment.
nit: Please rename result to snapshot.
Problem
Transaction.get(ref) followed by transaction.set(ref, {...}) is causing the transaction to fail with error 'Document already exists' if the document was created by another app between the get and set.
Cause
'already-exists' is considered to be a permanent error for transactions, therefore will not be retried.
firebase-js-sdk/packages/firestore/src/core/transaction_runner.ts
Line 115 in f86f7de
Fix Issue: #6659