Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firestore: Fix FAILED_PRECONDITION when writing to a deleted document in a transaction #6550

Merged
merged 8 commits into from
Aug 26, 2022

Conversation

dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Aug 22, 2022

Note: This fix needs to be ported to android and ios.

Fixes #5871

@changeset-bot
Copy link

changeset-bot bot commented Aug 22, 2022

🦋 Changeset detected

Latest commit: 2b9f7d3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/firestore Patch
firebase Patch
@firebase/firestore-compat Patch

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 22, 2022

Size Report 1

Affected Products

  • @firebase/firestore

    TypeBase (0361bf3)Merge (1eeecde)Diff
    browser264 kB264 kB+34 B (+0.0%)
    esm5327 kB327 kB+34 B (+0.0%)
    main525 kB526 kB+83 B (+0.0%)
    module264 kB264 kB+34 B (+0.0%)
    react-native264 kB264 kB+34 B (+0.0%)
  • @firebase/firestore-lite

    TypeBase (0361bf3)Merge (1eeecde)Diff
    browser80.8 kB80.9 kB+34 B (+0.0%)
    esm596.6 kB96.7 kB+34 B (+0.0%)
    main136 kB136 kB+83 B (+0.1%)
    module80.8 kB80.9 kB+34 B (+0.0%)
    react-native81.0 kB81.1 kB+34 B (+0.0%)
  • bundle

    TypeBase (0361bf3)Merge (1eeecde)Diff
    firestore (Transaction)184 kB184 kB+34 B (+0.0%)
    firestore-lite (Transaction)80.4 kB80.5 kB+34 B (+0.0%)
  • firebase

    TypeBase (0361bf3)Merge (1eeecde)Diff
    firebase-compat.js739 kB739 kB+36 B (+0.0%)
    firebase-firestore-compat.js314 kB314 kB+36 B (+0.0%)
    firebase-firestore-lite.js86.2 kB86.3 kB+34 B (+0.0%)
    firebase-firestore.js313 kB313 kB+34 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/B24XkO3UsH.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 22, 2022

Size Analysis Report 1

Affected Products

  • @firebase/firestore

    • runTransaction

      Size

      TypeBase (0361bf3)Merge (1eeecde)Diff
      size116 kB116 kB+33 B (+0.0%)
      size-with-ext-deps177 kB177 kB+34 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/3qs6w3fR09.html

@dconeybe dconeybe merged commit b993aee into master Aug 26, 2022
@dconeybe dconeybe deleted the dconeybe/FixTransactionSetOnDeletedDoc branch August 26, 2022 01:06
@google-oss-bot google-oss-bot mentioned this pull request Aug 31, 2022
@firebase firebase locked and limited conversation to collaborators Sep 26, 2022
@dconeybe
Copy link
Contributor Author

NOTE: This PR introduced a bug: #6659 "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."

The fix will be to consider ALREADY_EXISTS a retryable failure (currently, it is considered a permanent failure) so that the transaction will simply be retried.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FAILED_PRECONDITION error when committing transaction to clean Firestore Emulator
4 participants