Skip to content

fix(firestore): fail iOS transaction timeout without SDK retry - #9303

Draft
russellwheatley wants to merge 3 commits into
mainfrom
feature/cprn-426-9298-ios-firestore-hard-abort-in-transactiongetdocument
Draft

fix(firestore): fail iOS transaction timeout without SDK retry#9303
russellwheatley wants to merge 3 commits into
mainfrom
feature/cprn-426-9298-ios-firestore-hard-abort-in-transactiongetdocument

Conversation

@russellwheatley

@russellwheatley russellwheatley commented Sep 8, 2026

Copy link
Copy Markdown
Member

iOS runTransaction was returning a retryable Firestore DeadlineExceeded after the 15s JS-bridge wait. The SDK retried, and a leftover transactionGetDocument hit EnsureCommitNotCalled.

Fail that wait with a non-FIRFirestoreErrorDomain timeout so the SDK does not retry. That is required with this design: prepare resets get eligibility, so a retry would make a leftover JS get look live on the next FIRTransaction. Android still throws retryable DEADLINE_EXCEEDED, so the same slow updateFunction fails once on iOS and keeps retrying on Android.

  • Isolate leftover get and applyBuffer. Leftover get rejects deadline-exceeded (or aborted if disposed). A missing id still rejects internal-error. Leftover applyBuffer is a no-op.
  • JS skips applyBuffer / a second reject once the id is already finished

Maintainer note: Fixes internal CPRN-426

@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.52%. Comparing base (695161f) to head (389a653).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9303      +/-   ##
============================================
+ Coverage     69.49%   69.52%   +0.04%     
- Complexity     2129     2130       +1     
============================================
  Files           439      439              
  Lines         25472    25475       +3     
  Branches       4251     4252       +1     
============================================
+ Hits          17700    17710      +10     
+ Misses         6365     6361       -4     
+ Partials       1407     1404       -3     
Flag Coverage Δ
android-native 65.93% <ø> (+0.01%) ⬆️
e2e-ts-android 54.49% <71.43%> (+0.05%) ⬆️
e2e-ts-ios 53.90% <71.43%> (-<0.01%) ⬇️
e2e-ts-macos 49.96% <71.43%> (-<0.01%) ⬇️
ios-ruby 100.00% <ø> (ø)
jest 47.92% <85.72%> (+0.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@russellwheatley russellwheatley changed the title Fix iOS Firestore transaction abort after 15s timeout fix(firestore): fail iOS transaction timeout without SDK retry Sep 8, 2026
A late get after the 15s wait could beat native completion and surface as
internal-error. Missing ids stay internal-error; dispose stays aborted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant