Repository navigation
feat: add capability-driven routine debugging workspace - #1460
Conversation
| sessions.retain(|_, s| { | ||
| (s.started && s.terminal.is_none()) || s.created.elapsed() < Duration::from_secs(300) | ||
| }); | ||
| if sessions.values().filter(|s| s.owner == owner).count() >= 16 { |
There was a problem hiding this comment.
WARNING: Native preview leaks when the session cap or expiry rejects it
The plugin has already created a native preview (native_call(... Preview) above) before the 16-session cap is checked. When this returns Err, the native preview_id is dropped with no Stop/discard sent to the plugin. The retain above (line 103) has the same problem: expired, never-started previews are silently removed from the host map without any native cleanup. A plugin that holds resources per preview (connections, compiled state) will accumulate them. Check the cap before calling the plugin, and send a cleanup for evicted previews.
| .. | ||
| } => { | ||
| if session_id.is_empty() || frame_id.is_empty() { | ||
| return Err("Variable reads require a session and frame".into()); |
There was a problem hiding this comment.
WARNING: ReadVariables.names is passed to the native debugger without any validation
Only session_id and frame_id are checked. names is unbounded in count and length, may contain empty strings, and the PR itself notes that inspection can evaluate code in a native debugger (see the doc comment on validate). The UI forwards the raw comma-separated watch text. Add a cap on the number and length of names and reject empty entries at the host boundary, so a plugin never receives arbitrary-size input from a web client.
| ), | ||
| ); | ||
| }, | ||
| [client, connectionId], |
There was a problem hiding this comment.
WARNING: Cleanup effect re-runs when client identity changes and stops a live session
The effect's cleanup runs on every dependency change, not only on unmount. If useTabularisClient() returns a new object (e.g. on reconnect or provider re-render), the cleanup sends stop for the active session and nulls sessionId.current while the modal is still open, silently killing a running debug session and leaving the UI controls dead. Keep the latest client/connectionId in refs and use an empty-dependency unmount effect.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The incremental changes since
Earlier findings on Files Reviewed (2 files)
Notes: Review was based on the incremental diff and targeted file reads; tests were not executed (read-only mode). Previous Review Summaries (2 snapshots, latest commit 806bc70)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 806bc70)Status: No Issues Found | Recommendation: Merge The incremental changes since
Files Reviewed (8 files)
Notes: Review was based on the incremental diff and targeted file reads; tests were not executed (read-only mode). Previous review (commit a59b848)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (41 files)
Notes: Review was based on the diff and targeted file reads; tests were not executed (read-only mode). Reviewed by claude-sonnet-5.5 · Input: 250 · Output: 2.1K · Cached: 284.2K Review guidance: REVIEW.md from base branch |
NewtTheWolf
left a comment
There was a problem hiding this comment.
Thanks for keeping debugger resources behind a versioned driver capability and sharing session ownership across desktop and web. I reviewed 806bc70cbd802eaa269210457f7a1bbcdcae5674. The 17 existing Rust debugger tests and six frontend/transport tests passed, as did typecheck, targeted source ESLint and the production frontend build.
I reproduced one cleanup gap with an additional deferred-response component test: start Preview, close/unmount the modal before the request resolves, then let the preview reply arrive. Only the preview request is sent; no stop is sent for the returned preview ID. Unmount cleanup sees a null ID, and the late reply stores the ID after that cleanup has already run. The native preview and host session reservation therefore remain until later expiry/disconnect cleanup. Repeated attempts can consume the 16-preview capacity.
Please dispose late preview responses after unmount, using the owning connection and latest client, and add this pending-preview-close regression. The backend test that removes a pending session does not cover this UI path because closing the modal never sends that removal. I have not run native Oracle E2E, and I am holding this open for the cleanup fix.
| const next = await client.call('routine_debug', {connectionId, version: 1, command}); | ||
| if (next.kind === 'preview') { | ||
| sessionId.current = next.preview_id; | ||
| sessionConnectionId.current = connectionId; |
There was a problem hiding this comment.
[P2] Dispose preview responses that arrive after the modal closes. If unmount occurs while client.call is pending, stopOnUnmount sees sessionId.current === null. The continuation later stores next.preview_id, but no cleanup runs again. A deferred-preview component test reproduces zero stop requests after unmount. Track disposal and stop a late preview with its owning connection/latest client instead of retaining it.
NewtTheWolf
left a comment
There was a problem hiding this comment.
Thanks for handling the preview that arrives after the modal has closed. The cleanup now stops that preview using its original connection, including when the client instance changes while the request is pending.
I reran the six modal tests and my independent delayed-preview regression that failed on the previous revision. All pass, along with the 17 Rust debugger/contract tests, typecheck and targeted source lint. The previous resource-leak blocker is resolved. Approved.
Behaviour
Adds the shared host and workspace for #1411. A driver declaring
routine_debug: 1offers a routine context-menu debugger: select the routine identity and inputs, preview the target and engine warnings, then explicitly start. The workspace exposes source/current stop, breakpoints, stepping, stack, scalar watches and OUT/return values, including unavailable/partial/stale states.Companion Oracle plugin PR: TabularisDB/tabularis-oracle-plugin#26. It supplies the real native implementation and live Oracle tests. This host change alone does not enable debugging in existing plugin releases.
Safety and plugin behaviour
Validation
cargo test --no-default-features --lib routine_debug, including preview limits, expiry/disconnect cleanup, failed/disconnected preview requests, start/discard races and watch-input limits.cargo check --no-default-featuresand desktopcargo check.30219da86070ce40750a192811aef6bd6254d847, against Oracle AI Database 26ai Free23.26.3.0.0/ Instant Client23.26.2.0.0. The test exercised the real stdio plugin withORACLE_TEST_HOSTset, including unused preview disposal, entry stops, breakpoint replacement/deduplication, all step modes, variables, numeric OUT/return values, exceptions, cancellation, EOF, rollback and target/controller cleanup.806bc70c, including main tests and web E2E, PostgreSQL, MySQL 5.7/8.4, accessibility, contrast and formatting. The incremental automated review confirms all three findings are resolved and reports no new issues. The Windows desktop test executable failed to load locally withSTATUS_ENTRYPOINT_NOT_FOUND; the same shared tests pass locally without the desktop feature, and desktop tests pass in CI.The companion implementation supports precompiled standalone procedures/functions with scalar numeric/character arguments. Packaged overloads and composite/date parameters are explicitly unsupported. Upstream Oracle workflows still require maintainer approval; the passing fork job validates the exact companion commit.