window.confirm() never shows a dialog and auto-accepts: destructive actions run without confirmation #70
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
How it was found: clicking through the
98be903build (main, v2 merged) in a headless BOS live VM on 2026-10-13.What happened:
hyprctl clientslisted only the bos-settings window. 3s latergetent passwd secondwas empty and its home directory was gone.Confidence: high for the behavior (seen twice, confirmed through the guest's system state). Medium for the cause: WebKitGTK/wry in Tauri 2 does not show native JS script dialogs, so
confirm()resolves without asking the user.Bug: the frontend guards every destructive action with plain
confirm(), 14 calls in total. Among them: Users.svelte remove_user, Storage.svelte (empty trash, caches, unused deps), Snapshots.svelte delete, Keybinds.svelte remove layout, Bluetooth.svelte forget, Sharing.svelte enable SSH, ServiceControl.svelte stop critical service, Autostart.svelte core services, Updates.svelte update without snapshot, PowerMenu.svelte sleep/restart/power off, GetAppsHub.svelte AUR, Backup.svelte. None of them actually asks.Fix: replace
confirm()with an in-app confirm sheet (matching the v2 Sheet component), or@tauri-apps/plugin-dialogask()(dialog:default is already in capabilities). Add a lint/grep check that bans bareconfirm(/alert(in frontend/src.PR: #76 (head
edfa3b8)Review of PR #76 at exact head
edfa3b8df1(base main14d1315): PASS. Not merged: this reviewer has no authenticated Forgejo write tools.Criteria:
Checks run by me on this SHA in a detached scratch worktree:
Non-blocking note: Sheet's Escape listener uses stopPropagation, not stopImmediatePropagation, so pressing Escape on a confirm opened from inside another Sheet (Snapshots delete) also closes that underlying sheet. The action still does not run. A cosmetic follow-up is fine.
Next action: coordinator or an authorized user merges with a merge commit (expected head
edfa3b8), then verifies on the integrated commit.Re-reviewed at
bfa068dafter the base merge (PR #76 comment 4725) and merged asd432319. Verified ond432319: svelte-check 0/0, npm test including the confirm ban test (no bare confirm/alert/prompt in frontend/src, Memory/Display/Bluetooth included), build, fmt, clippy -D warnings, cargo test 179 passed. Live VM evidence from the original head: Remove shows the in-app sheet with the account intact, Cancel keeps it, confirming removes account and home.