Repository navigation
Conversation
Owner
|
Merged in 2a825ba, thanks for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3867.
transaction()resolves the enclosing engine (resolved), but then created theTransactionwiththisas its parent. For a nested transaction this meant the inner_TransactionStreamStoredispatched its table updates straight to the top-level stream store when the savepoint was released, while the outer transaction was still open. With a single connection the re-run query happens to wait for the outer transaction, so the bug was masked; withMultiExecutorthe read connection re-runs the query before the outer commit, sees old data, and the stream is never notified again.Passing
resolvedas the parent routes nested updates into the enclosing transaction's store, so they reach the top-level streams after the outermost transaction completes, as documented.Tests
nested transactions notify about table updates after the outer transactiontotest/database/transactions_test.dart. It fails before the change (top-levelhandleTableUpdatesis called while the outer transaction is still open) and passes after.MultiExecutor+NativeDatabase(WAL) repro locally:FAILS: read pool + nested transactionfails before the change and passes after; the other two cases pass both ways. I didn't commit that file.Validation (Dart 3.13.4)
dart test test/database/transactions_test.dart: 18/18 passdart test test/database test/engines test/integration_tests test/isolate_test.dart: 741 pass, 4 skippeddart format --set-exit-if-changedanddart analyze --fatal-infoson the changed files: cleanI resolved the workspace without the Flutter packages because there's no Flutter SDK on my machine, so I haven't run the Flutter-dependent packages' tests.