Desktop RTDB: a transaction callback abort on a rerun completes the Future with kErrorNone
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
Direzione di ricerca
In database/src/desktop/core/repo.cc, leggi prima StartTransaction e RerunTransactionQueue, seguendo abort_reason, l'errore locale, FutureToComplete e CompleteWithResult. Riproduci o aggiungi una coverage per un rerun attivato da datastale il cui callback esegue l'abort; il lavoro è completato quando Future segnala un codice di abort non riuscito invece di kErrorNone e non viene segnalato alcun commit.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Environment
- Firebase C++ SDK 13.9.0 (desktop; the cited code is unchanged at the 13.11.0 tag)
Summary
On desktop, if the DoTransaction callback aborts on the first invocation, the future completes with kErrorWriteCanceled (11) — see Repo::StartTransaction:
https://github.com/firebase/firebase-cpp-sdk/blob/3d7ce2a584d0b8daf1374bc2534c6ea71fa7fd6c/database/src/desktop/core/repo.cc#L659-L729
But if the abort happens on a rerun invocation (after a datastale response forces the transaction to run again), the abort reason is taken from a local error variable that was initialized to kErrorNone:
RerunTransactionQueue()initializesError error = kErrorNoneat line 1067. If the rerun callback returns abort, line 1095 assigns that unchanged zero value to the function-localabort_reason.- Lines 1111–1112 copy
abort_reasonand the current input intoFutureToComplete. No later assignment changes the reason: line 1129 references the queued value, and lines 1131–1134 complete the Future withCompleteWithResult(..., abort_reason, snapshot).
The result: the Future completes with error() == kErrorNone and a snapshot — indistinguishable from a successful commit — for a transaction that was aborted and never committed.
Expected
A rerun-invocation abort should complete with the same abort code as a first-invocation abort (or, better, with kErrorTransactionAbortedByUser to match the mobile SDKs), never with kErrorNone.
Impact
Consumers that branch on the future's error to decide "did my transaction commit?" will believe an aborted transaction succeeded whenever the abort happened after a datastale rerun — e.g. optimistic/fenced updates that abort once fresh data shows another writer won. In the FlutterFire Windows plugin this surfaces as TransactionResult(committed: true) for an aborted transaction.
Related
Filed alongside a second desktop transaction-error report: Repo::HandleTransactionResponse collapses every non-datastale server error (including permission_denied) to kErrorUnknownError with an empty message. Both were found while debugging the same Windows application.
- Lingua principale
- C++
- Stelle
- 326
- Fork
- 138
- Merge medio
- 2g 16h
- PR unite (30g)
- 3
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di firebase/firebase-cpp-sdk
-
api: firestore
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
firebase/firebase-cpp-sdk#1920 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
firebase/firebase-cpp-sdk#1904 · 1 commento ·
-
new type: question
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
firebase/firebase-cpp-sdk#1892 · 1 commento ·
-
nightly-testing
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
firebase/firebase-cpp-sdk#1859 ·
-
nightly-testing
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
firebase/firebase-cpp-sdk#1858 ·
Tutte le issue di firebase/firebase-cpp-sdk
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
games-on-whales/wolf#509 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
bug-unconfirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100