Skip to content

Copy long strLs whole, stop a timed-out restore from rerunning, keep piped parse output, and fix four Send to Stata slips - #421

Merged
jbearak merged 6 commits into
mainfrom
t3/fix-extension-release-bugs
Nov 19, 2026
Merged

jbearak merged 6 commits into
mainfrom
t3/fix-extension-release-bugs

Conversation

@jbearak

@jbearak jbearak commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

A review of v0.15.1..main before a stable release found six bugs outside the statement detector. Two are regressions: copying a long strL leaves the clipboard unchanged, and a setting that was valid in v0.15.1 now shows as invalid. The others: a slow restore runs twice, sight parse --json truncates piped output, queued sends leak temp files, and the cursor moves after a cancelled send. Part 1 (Send Statement under #delimit ; and the release workflow's tests) is a separate PR. Each case below reproduces on main with a failing test.

  1. Data Browser: copying a long strL left the clipboard unchanged (regression). For a strL longer than its 256-byte preview, Glide awaited the full value and then wrote it to the copy event after the event was over, which does nothing. A mixed selection with such a cell went the same way. A capture-phase copy listener now takes these copies before Glide sees them. It calls preventDefault() and stopImmediatePropagation() before any await, fetches the values, builds Glide's text with getCopyBufferContents, and has the host write it with vscode.env.clipboard, as Copy Column already does. That avoids depending on webview clipboard permissions. A failed write shows an error. Previews copied because the full values couldn't be read show a warning. Selections Glide can copy at once still go to Glide.
  2. Data Browser: a restored filter ran twice after its deadline. If the combined restore job hit the ten-minute deadline, the panel fell back to computing the sort and filter again on their own. A deadline now settles the restore after the one attempt, keeps the saved prefs, and warns that it was stopped after 10 minutes. The fallback for ordinary read failures stays.
  3. sight parse --json truncated piped output when a file failed. src/cli.ts called process.exit while stdout still held data the pipe hadn't taken, so a slow reader got 65,536 bytes and no complete record. Any non-zero exit from check, graph or parse now sets process.exitCode and lets the process end on its own, with a 5 s limit in case a handle keeps it alive. A write callback can't stand in for this, because Bun calls it before the pipe has the data. sight console still exits at once. Not changed: src/console/editor-console-tty.ts also calls process.exit, but that file is outside this PR's scope.
  4. "sight.sendToStata.target": "auto" showed an invalid-value warning (regression). The extension reads it as ask, but the manifest enum dropped it. It is back as the last enum value, described as the older name for ask. A test checks that the enum holds every value the extension reads and that each value has a description.
  5. Disposing a starting console's queue leaked temp files. Dispose forgot queued sends without deleting their files. It now deletes the files of sends it never typed. A send on a console's command line gets a scheduled cleanup instead, since the console may still run it. The Perch queue is the same class and gets the same fix.
  6. Cancelling the session picker moved the cursor. With a Stata session from another window, dismissing the picker returned the same result as a delivered send, so the cursor moved past code that never ran. The send now rejects with SendCancelledError. The send command (commands.ts), the cd commands and the resend path treat that as "nothing sent": no error, and no cursor move. A send waiting on a session open that was cancelled is cancelled too.

Proof: each fix has a test that fails on main. Those tests are tests/unit/data-browser/copy-selection.test.ts, a copied-text case and a deadline case in restore-cancel.test.ts, tests/integration/cli-exit-drain.test.ts, the manifest cases in target-choice-core.test.ts, the dispose case in console-terminal-core.test.ts, and the dismissed-picker case in send-to-stata-integrated-terminal.test.ts. The CLI test pipes into a reader that waits before reading. It fails on main under both bun src/cli.ts and the bundled node dist/sight-server.js, and passes on both here. The bundled case is skipped when dist/ isn't built. The copy fix is tested at module level and through the host message. It has not been run by hand in a VS Code webview. check:line-endings, typecheck, bun test ./tests (10,019 pass, 0 fail) and lint each pass when run separately on this branch. bun run package builds the extension, and the bundled webview includes the new listener.

Created with Claude Opus 5.5 in Claude Code.

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 86 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: a9cfe18b-d9a8-47d0-9f3e-08c25e4b25d2
Commits

Reviewing files that changed from the base of the PR and between b8819dc and 85d9e0f.

Files selected for processing: 16

  • client/package.json
  • client/src/data-browser/browser-panel.ts
  • client/src/data-browser/types.ts
  • client/src/data-browser/webview/app.tsx
  • client/src/data-browser/webview/copy-selection.ts
  • client/src/send-to-stata/cd-context.ts
  • client/src/send-to-stata/commands.ts
  • client/src/send-to-stata/console-terminal-core.ts
  • client/src/send-to-stata/stata-terminal-manager.ts
  • src/cli.ts
  • tests/integration/cli-exit-drain.test.ts
  • tests/integration/send-to-stata-integrated-terminal.test.ts
  • tests/unit/data-browser/copy-selection.test.ts
  • tests/unit/data-browser/restore-cancel.test.ts
  • tests/unit/send-to-stata/console-terminal-core.test.ts
  • tests/unit/send-to-stata/target-choice-core.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@jbearak
jbearak force-pushed the t3/fix-extension-release-bugs branch from a1db60d to 16b5380 Compare November 19, 2026 14:50
jbearak and others added 6 commits November 19, 2026 09:51
With one file failing, the CLI called process.exit while stdout still
held output the pipe hadn't taken, so a slow reader got the first
64 KiB and no complete record. A failing sight check, graph, or parse
now sets the exit code and lets the process end once output flushes,
with a 5 s limit in case a handle keeps it alive. A write callback
can't stand in: Bun calls it before the pipe has the data.

Co-authored-by: Claude Opus 5.5 <[email protected]>
…not run it twice

When the combined restore job ran out its deadline, the panel fell
back to computing the sort and filter again on their own, so a saved
filter that took over ten minutes ran a second time. A deadline now
settles the restore unapplied after the one attempt, keeps the saved
prefs, and warns that it was stopped after 10 minutes.

Co-authored-by: Claude Opus 5.5 <[email protected]>
…pboard as it was

Copying a selection holding a strL longer than its 256-byte preview
fetched the value from the host, and Glide then wrote it to the copy
event after the event was over, which does nothing. A capture-phase
copy listener now takes such a copy before Glide sees it, fetches the
values, and has the host write the text with vscode.env.clipboard. A
failed write shows an error; previews copied because the full values
couldn't be read show a warning. Selections Glide can copy at once
still go to Glide.

Co-authored-by: Claude Opus 5.5 <[email protected]>
… warning

The extension still reads auto as ask, but the manifest's enum dropped
it, so settings that held it got an invalid-value squiggle. It is back
in the enum, last, with a description that points to ask. A test checks
the enum holds every value the extension reads and that each value has
a description.

Co-authored-by: Claude Opus 5.5 <[email protected]>
A send queued for a console still starting hands its temp file to the
queue, but disposing the queue (on deactivation) forgot its entries
without cleaning them up, leaking the files. Dispose now deletes the
files of sends it never typed, and schedules cleanup for a send on a
console's command line, which the console may still run.

Co-authored-by: Claude Opus 5.5 <[email protected]>
With a Stata session from another window, a send first asks which
session to use. Dismissing that choice returned the same result as a
delivered send, so with cursor advancement on the editor moved past
code that never ran. The send now rejects with SendCancelledError,
which the send and cd commands take as nothing sent: no error and no
cursor move. A send waiting behind a session open the user cancelled
is cancelled the same way.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant