Repository navigation
v1.30.1
-
Fix: an asynchronous commit failure in
Transaction.execute/executeOrError
hung the caller; it now reaches the caller, and the transaction is finished
(isFinished,resultFuture). The commit runs inside the transaction's
errorZone, and Dart never delivers aFuture's error across error zones:
it was only reported as an uncaught error ([Transaction ERROR]), and
executenever completed. This covers both a failing closer and an adapter's
failingCOMMIT(itstransactionResult: PostgreSQL, MySQL, SQLite), and
alsoTransaction.executeBlockand the repository operations that use it.
A synchronous result (or error) is still returned (or thrown) synchronously,
and a commit error is still never passed toonError. -
Transaction: a failed commit (sync or async, also fromcommitcalled
directly) finishes the transaction as aborted, with a
TransactionAbortedError(reason: 'Commit failed') wrapping the commit
error (also inerror):isCommittingis no longer lefttrue, the
transactionFuture(if not completed yet) andresultFuturecomplete, and
executingTransactionis cleared. A concurrent 2ndcommitthen returns
null(as for an aborted transaction). -
Transaction: theresultFutureof an aborted transaction now completes
also when the adapter fails itstransactionResult(the rollback of the
PostgreSQL/MySQL/SQLite adapters): it never completed. -
Transaction: an adapter'sCOMMITerror notified to an auto-commit
transaction no longer re-commits it (which only returned the failing
transactionResultagain, as an unlistened, uncaught error). -
Transaction.toString: no infinite recursion when itsabortErrorwraps an
error that describes the transaction (a failedCOMMIT's
DBAdapterException). -
New tests: an asynchronous and a synchronous failing commit (
execute,
executeOrError,executeBlock,commit, auto-commit), a failing
transactionResult(with and without a block error), the transactions after
a failed commit, an asynchronous successful commit, and synchronous results.
With a real failingCOMMIT: SQLite (a deferred foreign key), PostgreSQL (a
deferred unique constraint) and MySQL (the connection closed before the
COMMIT). -
Dependencies:
- Updated
swiss_knifeto ^3.4.2 (bug fixes; of thembones_apiis only
affected byMimeType.parse:mp3isaudio/mpeg, thejpeg/txt
aliases keep the charset, and'/foo'is invalid). - Updated
mercury_clientto ^2.4.1: aStringrequest body is encoded
with theContent-Typecharset (APIModuleProxyHttpCallersends JSON,
still UTF-8), and on the VM binary responses (images other than SVG,
audio, video, fonts) stay bytes even with acharset. - Updated
args_simpleto ^1.3.0 (--ends the options,--key=valueis
split,-D/-Pproperties only with=/:):APIServerConfig.fromArgs
reads only named options and flags, unaffected. - Updated
graph_explorerto ^1.2.0 andascii_art_treeto ^1.1.3: the
SQLBuilderhierarchical order (toHierarchicalOrder) uses a stable
sortByInputDependency(tied SQLs keep their order; the order is still
validated, with its fallback). - Updated
dart_spawnerto ^1.3.0: the CLI's spawned isolates
(spawnDartScript, used bybones_api serve/console) are no longer
reported as exited (exitCode0) when they don't answer a ping within
2s with the VM service enabled. build_runnerkept at ^2.16.2: 2.17 requiresbuild5, and
reflection_factory2.13 requiresbuild^4.
- Updated