Update to T3 Code 0.1.1 with Electron 44.9.1, which no longer trusts + the compromised eMudhra intermediate certificates.
+Reclaim database space from Settings without installing a command-line + launcher. Update track changes are disabled because Flatpak manages updates.
+{previewStreamHostSetupMessage(hostSetup)}
@@ -153,13 +153,13 @@ index b8f403598..a07843935 100644 Try again diff --git a/packages/client-runtime/src/preview/serverBrowserStream.ts b/packages/client-runtime/src/preview/serverBrowserStream.ts -index 34a378697..6b995950b 100644 +index b71fff335..9d5ab790a 100644 --- a/packages/client-runtime/src/preview/serverBrowserStream.ts +++ b/packages/client-runtime/src/preview/serverBrowserStream.ts -@@ -476,7 +476,13 @@ const decodeHostSetup = (reason: string): PreviewStreamHostSetup => { +@@ -454,7 +454,13 @@ const decodeHostSetup = (reason: string): PreviewStreamHostSetup => { + return { need: "sandbox", command: "sudo npx t3 browser setup" }; }; - /** What a viewer tells the person; `command` is shown beside it, ready to copy. */ -export const previewStreamHostSetupMessage = (setup: PreviewStreamHostSetup) => - setup.need === "sandbox" +export const previewStreamHostSetupMessage = (setup: PreviewStreamHostSetup) => { @@ -173,15 +173,14 @@ index 34a378697..6b995950b 100644 : "This server's host is missing libraries its browser needs. Run this once on the host, then try again:"; +}; diff --git a/packages/contracts/src/preview.ts b/packages/contracts/src/preview.ts -index 802bbd476..126fa9af8 100644 +index 455663155..793b30a9f 100644 --- a/packages/contracts/src/preview.ts +++ b/packages/contracts/src/preview.ts -@@ -188,7 +188,7 @@ export type PreviewRuntime = typeof PreviewRuntime.Type; +@@ -154,6 +154,7 @@ export type PreviewRuntime = typeof PreviewRuntime.Type; */ export const PreviewStreamHostSetup = Schema.Struct({ need: Schema.Literals(["sandbox", "libraries"]), -- /** For example `sudo npx t3 browser setup`, matching how the server was launched. */ -+ /** For example `sudo npx t3 browser setup`. Empty when host setup must be done manually. */ ++ /** Empty when host setup must be done manually. */ command: Schema.String, }); export type PreviewStreamHostSetup = typeof PreviewStreamHostSetup.Type; diff --git a/patches/0011-flatpak-database-maintenance.patch b/patches/0011-flatpak-database-maintenance.patch new file mode 100644 index 0000000..f678721 --- /dev/null +++ b/patches/0011-flatpak-database-maintenance.patch @@ -0,0 +1,744 @@ +diff --git a/apps/desktop/src/app/DesktopDatabaseMaintenance.test.ts b/apps/desktop/src/app/DesktopDatabaseMaintenance.test.ts +new file mode 100644 +index 0000000000..dc19d91042 +--- /dev/null ++++ b/apps/desktop/src/app/DesktopDatabaseMaintenance.test.ts +@@ -0,0 +1,195 @@ ++import { assert, afterEach, it, vi } from "@effect/vitest"; ++import * as Deferred from "effect/Deferred"; ++import * as Effect from "effect/Effect"; ++import * as Fiber from "effect/Fiber"; ++import * as Layer from "effect/Layer"; ++import * as Option from "effect/Option"; ++import * as Sink from "effect/Sink"; ++import * as Stream from "effect/Stream"; ++import * as ChildProcess from "effect/process/ChildProcess"; ++import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner"; ++ ++import * as DesktopDatabaseMaintenance from "./DesktopDatabaseMaintenance.ts"; ++import * as DesktopEnvironment from "./DesktopEnvironment.ts"; ++import * as DesktopState from "./DesktopState.ts"; ++import * as DesktopBackendPool from "../backend/DesktopBackendPool.ts"; ++import * as ElectronDialog from "../electron/ElectronDialog.ts"; ++import * as ElectronWindow from "../electron/ElectronWindow.ts"; ++ ++const runtime = "/installed Flatpak/files/t3code"; ++const baseDir = "/home/alice/.var/app/com.t3tools.t3code/data/t3"; ++afterEach(() => vi.unstubAllEnvs()); ++ ++const harness = Effect.fn("test.databaseMaintenance.harness")(function* ( ++ options: { ++ runtime?: string; ++ response?: number; ++ exitCode?: number; ++ ready?: boolean; ++ confirm?: Effect.Effect{status.compactCommand}
+- >
++ maintenance ? (
++ <>
++ The database uses {(status.databaseBytes / 1024 ** 2).toFixed(1)} MiB, with{" "}
++ {(status.reclaimableBytes / 1024 ** 2).toFixed(1)} MiB available to reclaim.
++ Reclaiming space temporarily stops the local server. Finish active work first;
++ cleanup can take several minutes and needs temporary disk space. The server restarts
++ afterward.
++ >
++ ) : (
++ <>
++ Old history is cleaned up automatically, but this database still holds the freed
++ space. Run the command on {label} to return it to disk; it pauses and restarts the
++ background service. Quit the desktop app first if it hosts this environment.
++ {status.compactCommand}
++ >
++ )
+ }
+ control={
+