Repository navigation
feat: report completed results and transaction state - #916
Merged
Merged
Conversation
A query run that fails at statement N > 0 now carries the results of
statements 0..N-1 in QueryError.completedResults, so a script's earlier
results survive its error. A run on an editor tab's session reports the
server's transaction state ("open" | "none") on its last result, asked
with the same isolation-level probe grid saves already use, since sqlx
keeps SERVER_STATUS_IN_TRANS crate-private.
This completes the backend parts of #845 and #843; the frontend already
reads both fields. The mock query handler emits them too.
Closes #911
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
Worktrees that share a target directory through CARGO_TARGET_DIR had nothing cleaned: the script always looked under src-tauri/target. Closes #913 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
docker rm -f left each test container's anonymous data volume behind, so every db-reset leaked one. The CLAUDE.md cloud-session note also claimed Docker does not survive a container restart; /var/lib/docker does, and only dockerd needs starting. Closes #914 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
EVWorth
added a commit
that referenced
this pull request
Oct 29, 2026
* build: ignore scripts/ in the dev server watcher A helper written into scripts/ while `just dev-web` runs reloaded the page and wiped whatever state a review had reached. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * refactor(designer): read tables through a store TableDesigner called the table reads itself and kept their loading and error state. They now go through tableDetailsStore, keyed by the mounted view, so the store owns that state and the reads are tested there. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * refactor(schema): read table structure via store TableStructure read the table's columns, indexes, keys, partitions and DDL itself. It now asks tableDetailsStore, which owns the loading state and the per-part errors. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * fix(mock): drop unlistened events; honest restore The event mock in @tauri-apps/api looks for `args.id` on unlisten while the event API sends `eventId`, so no listener was ever removed and every emit after a dialog closed logged "Couldn't find callback id". The mock backend now passes the id under both names. A restore with every statement refused (read-only production, Stop on error off) reported partiallyApplied with nothing run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * feat(mock): inject command failures from the URL `?mock=connected&fail=get_foreign_keys,save_connection_profile` makes the named commands reject, with a QueryError for the three commands typed that way and the CoreError string for the rest, so every error state can be reviewed without wrapping invoke by hand. A trailing `*` matches by prefix. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * feat(mock): lost and multi-server scenarios `?mock=lost` connects Local dev and then loses its server: every health check fails and is reported, so the red tab and "Lost — retrying (n)" can be reviewed, and reads fail with 2013. `?mock=servers` adds a read-write production profile, a MariaDB that connects, a wrong password (1045) and a server that times out, each worded as the backend words it. The admin and restore handlers read profiles from the mock state rather than the static list, so the added profiles behave as listed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * fix(mock): reject ports that are not a u16 save_connection_profile and test_connection accepted any port. The Rust profile's port is a u16, so Tauri rejects 70000, -1 or 3306.5 before the command runs; the mock now rejects them with the same message. Port 0 gets through as it does in the app, and connecting to it is refused. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * refactor(backup): run backup, restore, import in a store The backup, restore and import dialogs called the API themselves and each kept its own run state. backupStore now owns the job id, progress, cancel and outcome of each run, and fileStore wraps the native file dialogs and file reads that these and other components use. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * feat(mock): update, keyring and startup switches `update=available|downloading|download-error|error` drives the updater plugin, including the download's progress channel; `keyring=missing` and `startup=problems` report the missing credential store and the stores that could not be opened, worded as the backend words them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * refactor(history): move file and history reads to stores QueryHistory, HistoryQuickOpen and QueryFavorites called the API for history reads and file dialogs. historyStore now owns the export to a file (with its exporting flag) and the quick-open search, and favoritesStore exports to and imports from a file. The component tests mock the stores; the file flows are tested in the store tests. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * feat(mock): history pages, shop events and users History grows to 130 entries, so paging can be tried; shop gets events in each state; the admin panel's Users and Roles tabs read accounts from mysql.user, the role tables and SHOW GRANTS, which the user statements change. The SQLite fixture already had a view (#825). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * refactor(admin): read processes, variables, grants via store ProcessListTab, ServerVariablesTab, UserDetail and PrivilegesEditor called the API themselves. adminStore now owns the process list (with kill), the server variables and an account's grants, with their loading and error state, keyed by the mounted tab. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * feat(mock): agent approvals, proposals and drafts An agent turn now picks its request from the message: approvals on production and staging, a schema change, propose_edit, open_draft, and two approvals at once. Requests are no longer queued in the mock, since the window queues them. `agent=uninstalled` reports no harness installed and `agent=no-tools` starts sessions without the database tools. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * refactor(layout): read app version and startup report via store StatusBar and the help dialog called the API for the app version, the keyring check and the startup report. appInfoStore now holds them. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * refactor(routine): read routine DDL through ddlStore RoutineViewer called the API for the routine's DDL and kept its own loading and error state. It now uses ddlStore, the same entry the DDL tab for that routine reads. A failure is shown as the server said it, without the "Error: " prefix String(e) added (#804). Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * refactor(connection): test a connection through the store useConnectionForm called the API to test a profile. connectionStore now has testConnection, which turns a failure into an unsuccessful result as the hook did. Refs #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * build(lint): forbid tauri-api imports in components Components call store actions, never api.* (src/CLAUDE.md). With the last direct calls moved into stores, a no-restricted-imports rule keeps new ones out. Type-only imports and tests are allowed. Closes #862 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * feat(mock): apply schema writes; reject bad DDL CREATE, ALTER, RENAME and DROP TABLE, CREATE and DROP INDEX and CREATE and DROP DATABASE now change the fixture, so the schema reads after a designer Apply show the change. Each statement is all-or-nothing, and invalid DDL such as `CREATE TABLE orders ()` fails with the server's 1064, with 1050, 1060, 1061, 1091 and 1146 for the other usual mistakes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * feat(mock): delay the first backup/restore event The first progress event arrived at once, so the dialog's state before any progress could not be reviewed. It now comes 450 ms in. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * fix(favorites): open a favorite as a clean tab Opening a favorite wrote its SQL into the tab without setting the saved baseline, so the tab showed as unsaved and closing it asked to save what had just been opened. Double-click into a new tab had the same problem. Both now mark the SQL as the tab's saved content. Closes #909 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * fix(transaction): clear TX flags on disconnect Disconnecting ends the connection's tab sessions, and the server rolls back any transaction they had open, but the tabs kept their TX badge. The disconnect path now forgets the transaction state of every tab bound to that connection. Closes #910 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * fix(results): drop "Error: " from a failed run outcome executeQuery's failed outcome carried String(e), so TableDesigner and RoutineViewer showed "Error: ..." where the results pane shows the message alone. The outcome now uses the same text as the pane. Closes #912 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * test(mock): cover completedResults and transaction After the merge of #916: the QueryError command check follows the regenerated bindings (QueryError_Serialize), and execute_query's completedResults and per-session transaction state have tests (#917). Closes #785 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g * docs: list the new mock scenarios in ui-preview Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g --------- Co-authored-by: Claude <[email protected]>
This was referenced Oct 30, 2026
Merged
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.
The backend side of #845 and #843, done by the
implementer-rustlane. The frontend from #908 already reads both new fields.Closes #911, #913, #914.
#911
QueryErrorgains an optionalcompletedResults: the results of the statements that ran before statement N failed (N > 0).QueryResultgains an optionaltransaction: "open" | "none".SET @@transaction_isolation = @@session.transaction_isolation. The server refuses that statement inside a transaction (ER 1568), so a refusal means one is open.@@in_transactionexists only on MariaDB, which is why it isn't read directly.SET, so a laterSELECT ROW_COUNT()on that session returns 0.LAST_INSERT_ID()andSHOW WARNINGSare unaffected. This is documented ontransaction_state.cargo test -p sqlpilot --test export_bindings. The mock'sexecute_queryemits both fields.#913 and #914
scripts/clean-debug.shnow cleans${CARGO_TARGET_DIR:-src-tauri/target}/debug.just db-downnow runsdocker rm -fv, so the containers' data volumes are removed with them.dockerdneeds starting.Tests
mas-core/src/error.rs.integration_tests.rs: a failed script returns what ran before it.editor_sessions.rs: BEGIN/COMMIT,autocommit = 0, implicit commit after DDL, no state off a session, and earlier results kept on a failed run.cargo fmtandclippy -D warningsare clean.cargo testpasses formas-core --lib,mas-mcpandsqlpilot.mas-coreintegration suite passes on MySQL (port 13306) and on MariaDB (port 13308).npm run type-checkis clean,vitestonsrc/dev,src/libandsrc/storespasses (1656 tests), andnpx dprint checkis clean.Generated by Claude Code