fix(startup): enforce consent before download handoffs

Gate clipboard, extension, and deep-link inputs until startup consent is resolved, and serialize extension readiness transitions so native prompts cannot race the app explanation. Identify consent by the build revision so same-version updates re-enter the consent boundary.

Requested by [this X post](https://x.com/ixabolfazl/status/2077356127763804450?s=20).
This commit is contained in:
NimBold
2026-07-15 21:48:00 +03:30
parent 9f333618fc
commit edeef0ac54
4 changed files with 90 additions and 12 deletions
+19
View File
@@ -1,13 +1,32 @@
import { defineConfig } from "vitest/config";
import { execFileSync } from "node:child_process";
import react from "@vitejs/plugin-react";
import tailwindcss from '@tailwindcss/vite';
// @ts-expect-error process is a nodejs global
const host = process.env.TAURI_DEV_HOST;
const buildId = (() => {
// Release-candidate builds can keep the same semantic app version. The
// source revision is the stable identity needed for consent migrations.
const configured = process.env.VITE_BUILD_ID?.trim();
if (configured) return configured;
try {
return execFileSync('git', ['rev-parse', 'HEAD'], {
encoding: 'utf8',
stdio: ['ignore', 'pipe', 'ignore']
}).trim() || 'unknown';
} catch {
return 'unknown';
}
})();
// https://vite.dev/config/
export default defineConfig(async () => ({
plugins: [react(), tailwindcss()],
define: {
'import.meta.env.VITE_BUILD_ID': JSON.stringify(buildId)
},
test: {
exclude: [
"Extensions/**",