Skip to content

fix(connections): ask before any caller runs a pre-connect script - #3381

Merged
datlechin merged 2 commits into
mainfrom
fix/preconnect-consent-all-callers
Oct 12, 2026
Merged

datlechin merged 2 commits into
mainfrom
fix/preconnect-consent-all-callers

Conversation

@datlechin

Copy link
Copy Markdown
Member

Why

A pre-connect script is shell code. Only the window and tablepro:// links asked before running it. MCP tools, the AI assistant, Compare, Copy To, a table's auto-load and a dropped tunnel's reconnect all reached connectToSession and ran it with no prompt.

Change

  • The decision now lives in DatabaseManager: every connect goes through PreConnectScriptConsent. A gesture that asked first (window, link) hands over a one-shot approval for that exact script; any other caller is asked at the connect.
  • TablePro's own connects (auto-load, tunnel recovery) never prompt and are refused. Recovery stops instead of retrying.
  • Pre-connect script and extension prompts close as Cancel after 60 seconds.
  • MCP and AppleScript when nobody answers: the call fails after 60 seconds. MCP gets timeout (denied on Cancel), AppleScript gets error -10000.

Verified

PreConnectScriptEntryPointTests drives each entry point (the bridge used by MCP, the assistant and AppleScript, Compare, Copy To, auto-load, tunnel recovery, a gesture) with a script that leaves a file if it runs.

Not in this PR

  • The password prompt still has no deadline.

@datlechin
datlechin merged commit 57564b7 into main Oct 12, 2026
5 checks passed
@datlechin
datlechin deleted the fix/preconnect-consent-all-callers branch October 12, 2026 13:09
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