Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
abdb695
fix(web): minimap previews keep tight list text together (#43681)
iamshadmantaqi Nov 26, 2026
39388dd
fix(server): .gitmodules comments and other sections no longer change…
only21mil Nov 26, 2026
9022118
fix(web): map search keeps IME Enter and Escape on the input (#43684)
2SinceJuly Nov 26, 2026
8a99245
fix(release): the desktop launch check works with the inspector fuse …
juliusmarminge Nov 26, 2026
fb78394
fix(shared): a leading horizontal rule no longer switches an ordinary…
saphid Nov 26, 2026
83d7e53
fix(mobile): usage widget never gives two accounts the same name (#43…
only21mil Nov 26, 2026
40958c3
fix(shared): Markdown links and images with uppercase HTTPS keep thei…
saphid Nov 26, 2026
bc0f04d
fix(client-runtime): typed checks and review qualifiers follow the Fi…
only21mil Nov 26, 2026
d8a52dd
fix(opencode): OpenCode 1.x threads keep streaming after a worktree h…
juliusmarminge Nov 26, 2026
17b5c1a
test(desktop): AppImage shim test's fake mounter traps signals before…
juliusmarminge Nov 26, 2026
9b4a5e1
fix(shared): chunked Markdown links keep the first definition’s desti…
saphid Nov 26, 2026
b403a7c
fix(client-runtime): workflow summaries skip code fences inside quote…
saphid Nov 26, 2026
6249fe9
fix(web): archive previews list numbered files and folders in natural…
only21mil Nov 26, 2026
f87ab0b
fix(web): storage retention ages say "1 day" and follow the UI langua…
only21mil Nov 26, 2026
2e830d7
chore(release): prepare v0.1.13
t3-code-bot[bot] Nov 26, 2026
87132a2
fix(shared): file previews no longer duplicate text that resembles a …
saphid Nov 26, 2026
fb84179
fix(web): workflow skipped count follows the picked workflow (#43708)
iamshadmantaqi Nov 26, 2026
81f8990
fix(web): digit keys typed into a file editor no longer answer a wait…
only21mil Nov 26, 2026
a066eb0
fix(shared): nonbreaking spaces no longer end Markdown fences or para…
saphid Nov 26, 2026
e07c808
fix(server): service launcher recovers a missing service-state.json (…
juliusmarminge Nov 26, 2026
484a0ee
fix(web): settings inheritance tooltips name project override counts …
only21mil Nov 26, 2026
5aa81ac
fix(shared): render Codex directives in over-indented lists (#43726)
saphid Nov 26, 2026
5389ed6
fix(web): settings search ranks a setting first when its translated t…
only21mil Nov 26, 2026
8d30a1d
fix(mobile): the branches sheet reaches local branches past the first…
only21mil Nov 26, 2026
6bec332
fix(shared): inline HTML before a code fence no longer turns sample t…
saphid Nov 26, 2026
3749a2e
fix(server): issue and PR views keep the waiting run when skipped run…
MinitJain Nov 26, 2026
8e8e15a
fix(shared): link file paths in over-indented lists for thread search…
saphid Nov 26, 2026
9b4943f
fix(shared): thread search indexes percent-encoded Windows file links…
saphid Nov 26, 2026
49a6653
fix(web): diagnostics I/O totals and process scan show in the app's l…
only21mil Nov 26, 2026
f08bafe
fix(web): image-only stashed prompts no longer show "(empty)" when an…
only21mil Nov 26, 2026
cc29be0
fix(web): EPUB chapters with a blank title use their heading (#43747)
only21mil Nov 26, 2026
09f2741
fix(shared): bare <a> placeholders no longer disable absolute file-pa…
saphid Nov 26, 2026
663421a
fix(desktop): silent Windows installs restart T3 Code when they had t…
juliusmarminge Nov 26, 2026
6eda4d0
fix(shared): a down HTTP quota source no longer adds /usage-limits to…
iamshadmantaqi Nov 26, 2026
eadd4e7
fix(server): a turn after a steered queued message reuses the last ch…
MauriceCRRR Nov 26, 2026
8994fe6
fix(shared): thread search no longer matches across a standalone imag…
saphid Nov 26, 2026
0a329e0
fix(web): preserve continuation indentation in lists with tabs (#43742)
saphid Nov 26, 2026
d023407
fix(server): a checkpoint no longer runs git status in every untracke…
MauriceCRRR Nov 26, 2026
b0e87e0
fix(web): the toast after importing a light and dark theme is transla…
only21mil Nov 26, 2026
e66a006
fix(server): Codex 0.171+ threads no longer get T3 context twice afte…
juliusmarminge Nov 26, 2026
340d4e8
fix(opencode): OpenCode 2 sessions get OpenCode's own title (#41832)
shivamhwp Nov 26, 2026
2858e6c
fix(web): the open title-bar panel toggle follows the contrast settin…
shivamhwp Nov 26, 2026
3f7acd7
fix(web): Arabic and Hebrew lines in markdown code fences read right …
shivamhwp Nov 26, 2026
c66881f
fix(web): closing an untouched Browser panel floats nothing (#41720)
shivamhwp Nov 26, 2026
7a8f65a
fix(web): a long pull request search no longer shows a space before i…
only21mil Nov 26, 2026
b6a054a
fix(shared): relative file links stay inside POSIX workspaces with li…
saphid Nov 26, 2026
8214922
fix(shared): copying a Codex citation with a pipe in its filename pre…
saphid Nov 26, 2026
5bd72c5
fix(shared): Codex citations preserve trailing spaces in literal file…
saphid Nov 26, 2026
3166b94
fix(desktop): clear activation renderer on render-process-gone (#43766)
greglum Nov 26, 2026
99420d6
fix(web): Codex threads keep their model when a catalog refresh omits…
juliusmarminge Nov 26, 2026
9c67c7d
fix(server): hub limits name the providers they skip instead of repor…
juliusmarminge Nov 26, 2026
f4b2523
fix(web): batch theme import names an oversized file in the UI langua…
only21mil Nov 26, 2026
6252f1f
fix(shared): copied Codex citations keep literal tildes in filenames …
saphid Nov 26, 2026
5596e74
fix(web): TSV previews keep literal quotes at page boundaries (#43783)
saphid Nov 26, 2026
a4ab2c5
fix(shared): Codex citations link relative POSIX filenames containing…
saphid Nov 26, 2026
43530f9
fix(shared): reference links in over-indented lists use document defi…
saphid Nov 26, 2026
7d2db83
fix(mobile): inline review comments stay open when the draft cannot b…
only21mil Nov 26, 2026
fd1694c
fix(usage): a failed reset credit shows the reason the server gave (#…
only21mil Nov 26, 2026
dcee01c
fix(shared): skip headings inside fenced plan examples (#43786)
StiensWout Nov 26, 2026
beb24ff
fix(server): drop retired Claude gateway models on refresh (#43787)
StiensWout Nov 26, 2026
1dba8e2
fix(shared): recognize thread links after carriage-return paragraph b…
StiensWout Nov 26, 2026
04770fe
fix(web): custom snooze calendar follows the app language (#43792)
only21mil Nov 26, 2026
314f59d
fix(usage): evaluate context-tier cliffs per model call on multi-call…
FelixIsaac Nov 26, 2026
d8193ac
fix(server): omit empty notebook output headings (#43809)
StiensWout Nov 26, 2026
59e80b7
fix(web): project folder names no longer run under the new-thread but…
nizarlj Nov 26, 2026
3ebc46f
fix(shared): Markdown previews keep first references with next-line d…
StiensWout Nov 26, 2026
f22d01b
fix(server): ACP info notices no longer show as warnings (#43795)
yaacovcorcos Nov 26, 2026
da36859
fix(web): keep the new-thread heading steady while typing (#43829)
Yash-Singh1 Nov 26, 2026
09d75fd
fix(mobile): PR attachment names show decoded file names (#43815)
only21mil Nov 26, 2026
8592f1b
fix(mobile): PR checkboxes still toggle after an empty task item (#43…
saphid Nov 26, 2026
6db795a
fix(client-runtime): iOS simulators without WebCodecs try WebRTC befo…
shivamhwp Nov 26, 2026
7068f98
fix(web): keep settings scope controls visible in narrow windows (#43…
Yash-Singh1 Nov 26, 2026
0ac7c99
fix(server): Antigravity health checks flag incompatible runtimes (#4…
StiensWout Nov 26, 2026
483c892
fix(web): browser tests no longer fail when a tester's first socket d…
juliusmarminge Nov 26, 2026
b79a254
fix(shared): keep fenced examples intact after inline HTML (#43803)
StiensWout Nov 26, 2026
0b6b173
fix(server): extract text from notebooks with a UTF-8 BOM (#43827)
Lucenx9 Nov 26, 2026
042dcff
fix(shared): Codex citations open forward-slash UNC paths in the curr…
saphid Nov 26, 2026
9f96e0d
fix(web): preserve links pasted into the composer (#42469)
juliusmarminge Nov 26, 2026
5478b88
fix(shared): Markdown links and images with uppercase FILE keep their…
saphid Nov 27, 2026
233378c
fix(shared): theme-aware Markdown images keep nonbreaking spaces in t…
saphid Nov 27, 2026
8222562
fix(mobile): an offline attachment-only new task is titled by its att…
only21mil Nov 27, 2026
a71d749
fix(opencode): grep results keep filenames containing colon-delimited…
saphid Nov 27, 2026
382f4b2
fix(mobile): switching machines in a new task finds the project in a …
only21mil Nov 27, 2026
d034b66
fix(server): a Claude child keeps its session for the wake turn of a …
juliusmarminge Nov 27, 2026
9534f2a
fix(server): separate EPUB figures from surrounding text (#43853)
Lucenx9 Nov 27, 2026
1bd40a6
fix(mobile): PR label filter keeps a host label's color after its sea…
only21mil Nov 27, 2026
81aac52
fix(shared): large Markdown files with CR-only line endings render in…
saphid Nov 27, 2026
e18c8fc
feat(web): copy a chat table as PNG (#43435)
rbansal42 Nov 27, 2026
3c4c168
fix(source-control): long PR diff lines no longer cut emoji in half (…
saphid Nov 27, 2026
ce26113
fix(web): scheduled task intervals say "1 minute" and follow the UI l…
only21mil Nov 27, 2026
bba8114
fix(relay): keep relay traces for 28 days (#43871)
juliusmarminge Nov 27, 2026
284c8d2
fix(web): PR label filter keeps a host label's color after its search…
only21mil Nov 27, 2026
c959fac
feat(mobile): configurable text and monospace fonts, SF by default on…
juliusmarminge Nov 27, 2026
236202a
fix(web): keep prompts unsent when pull request checkout fails (#43855)
StiensWout Nov 27, 2026
f38b7db
fix(shared): resolve Markdown links after indented code fences (#43819)
StiensWout Nov 27, 2026
ee5b846
fix(mobile): review comment snippets keep deleted -- and added ++ lin…
only21mil Nov 27, 2026
da0c243
fix(web): keep a moved draft in its new workspace (#43865)
StiensWout Nov 27, 2026
78de9d8
fix(server): long emoji guest file names keep whole characters (#43877)
only21mil Nov 27, 2026
270fb87
fix(server): re-importing a session updates its imported thread that …
juliusmarminge Nov 27, 2026
ca1680b
fix(web): resolve footnotes across chunked Markdown previews (#43801)
alboumKW Nov 27, 2026
a4f7b1e
fix(server): HTML renders with large comments prepare 7x faster (#43873)
trevoedwards Nov 27, 2026
aed2db7
fix(shared): preserve context links in BOM-prefixed code fences (#43817)
StiensWout Nov 27, 2026
9d963e3
fix(mobile): ZIP downloads with a minute left say "1 minute", not "1 …
only21mil Nov 27, 2026
34846ca
fix(server): honor token caps when budgeting context handoffs (#43868)
hfatih Nov 27, 2026
75fff25
perf(mobile): cut idle socket traffic to save battery (#36507)
t3dotgg Nov 27, 2026
002594a
test(server): fork /compact test outgrows the 64k handoff budget (#43…
juliusmarminge Nov 27, 2026
1d2a9b5
fix(web): keep excluded files after a failed new-branch commit (#43878)
StiensWout Nov 27, 2026
13a910f
fix(web): theme search cards count downloads in the UI language (#43890)
only21mil Nov 27, 2026
ac20e4d
fix(mobile): PR label and author filters ignore case like the list do…
only21mil Nov 27, 2026
b4d3a6b
fix(mobile): terminal menu names Windows folders by their last segmen…
pauldupuyjr Nov 27, 2026
7a93ea0
fix(server): omit inert templates from EPUB attachment text (#43885)
Lucenx9 Nov 27, 2026
48d6296
fix(web): hide ineffective mark unread actions during active runs (#2…
juliusmarminge Nov 27, 2026
903879f
fix(server): separate adjacent EPUB articles in attachment text (#43901)
Lucenx9 Nov 27, 2026
0b42e2e
fix(server): content search while indexing checks long lines in full …
only21mil Nov 27, 2026
1f56ac6
fix(mobile): keep an outdated review draft selected after canceling a…
saphid Nov 27, 2026
99e3d8b
fix(web): Changes opens the branch diff on a new thread (#43920)
juliusmarminge Nov 27, 2026
02d7a67
fix(mobile): Markdown with a leading byte-order mark keeps its rewrit…
only21mil Nov 27, 2026
56db9ef
fix(server): register Linux providers spawned through the ProcessLaun…
juliusmarminge Nov 27, 2026
cdb798a
fix(server): workspace preview Refresh shows current CSS, JS and imag…
juliusmarminge Nov 27, 2026
047590d
fix(web): preserve issue scroll position across tabs (#43928)
Yash-Singh1 Nov 27, 2026
5f65976
fix(web): PR author filter keeps a host author's avatar after its sea…
only21mil Nov 27, 2026
14ae67a
fix(web): pluralize process starts and exits independently in diagnos…
saphid Nov 27, 2026
c035572
fix(mobile): diff picker no longer shows glued section headers on iOS…
arifali123 Nov 27, 2026
09e4c7c
fix(server): ChatGPT sharing no longer offers Codex native sub-agents…
juliusmarminge Nov 27, 2026
fb2e365
fix(server): strip terminal color codes from notebook error messages …
only21mil Nov 27, 2026
769d3bc
fix(server): a superseded .gitmodules path no longer hides an indepen…
saphid Nov 27, 2026
65f1ec8
fix(desktop): recover connection catalogs after safeStorage key loss …
juliusmarminge Nov 27, 2026
df6378b
fix(server): a child woken by a Monitor is no longer cut off and misr…
Byntham Nov 27, 2026
4d69462
fix(web): a picked workflow shows one of its own runs (#43936)
iamshadmantaqi Nov 27, 2026
ddcc48f
feat(web): select and manage multiple side-panel tabs (#43946)
Yash-Singh1 Nov 27, 2026
09824d1
fix(mobile): announce singular additions and deletions in PR list row…
saphid Nov 27, 2026
9e38b0f
fix(web): review thread cards show "Outdated" in the UI language (#43…
only21mil Nov 27, 2026
3dbefda
fix(server): avoid duplicate formulas in EPUB attachment text (#43943)
Lucenx9 Nov 27, 2026
a7e204b
fix(web): J and K no longer step the PR review guide while a dialog, …
saphid Nov 27, 2026
543956a
fix(web): translate the opened timestamp on pull request hover cards …
saphid Nov 27, 2026
bdfc038
fix(mobile): keep the typed commit message after a failed commit (#43…
only21mil Nov 27, 2026
4358c92
fix(server): text generators accept replies without finish_reason or …
only21mil Nov 27, 2026
3066bad
fix(server): parse CLIProxyAPI cooldown reset times with provider nam…
FusselTV Nov 27, 2026
0e08cf3
fix(web): preserve EPUB styling in file previews (#43960)
Yash-Singh1 Nov 27, 2026
bddcfb7
fix(antigravity): defer optional T3 MCP tools via tool_call proxy (#3…
EliBlauBalto Nov 27, 2026
460ee0f
fix(web): EPUB preview no longer crashes when leaving a fixed-layout …
juliusmarminge Nov 27, 2026
7a5f9c2
fix(server): separate EPUB navigation from nearby text (#43961)
Lucenx9 Nov 27, 2026
76531c9
fix(web): highlight Greek PDF search hits across text runs (#43964)
saphid Nov 27, 2026
d8295b3
fix(web): closing browser tabs together reopens the active one first …
iamshadmantaqi Nov 27, 2026
dae7520
fix(mobile): Add environment address stays on one line on iOS (#43963)
jokaperes Nov 27, 2026
6118058
fix(provider-core): known provider updates no longer blink out while …
nikalezah Nov 27, 2026
538032a
fix(mobile): PR autolinks keep working after a leading byte-order mar…
only21mil Nov 27, 2026
ec2777c
test(web): wait for the EPUB frame to load before asserting its style…
juliusmarminge Nov 27, 2026
3e76d0a
fix(mobile): show-more announces one remaining settled thread correct…
saphid Nov 27, 2026
5dc88e4
fix(pr): show full file counts in Code view (#43986)
Yash-Singh1 Nov 27, 2026
bb263b9
fix(web): keep numbered copies of themes with long names (#43985)
jadelike-wine Nov 27, 2026
8e622f9
fix(server): keep Word table headings in their column when a document…
only21mil Nov 27, 2026
0ce6663
fix(web,mobile): changing a scheduled task's project clears the old p…
only21mil Nov 27, 2026
75f768b
fix(cli): keep default thread titles on the first line (#43990)
jadelike-wine Nov 27, 2026
9b58601
fix(server): separate EPUB disclosure summaries from their text (#43992)
jadelike-wine Nov 27, 2026
3c72b4e
fix(web): settings search matches the localized navigation label (#43…
saphid Nov 27, 2026
faceb33
chore(web): upgrade BetterOffice packages (#44001)
Yash-Singh1 Nov 27, 2026
0f38116
fix(web): show how many images a held send is waiting for in Russian,…
saphid Nov 27, 2026
d20571f
fix(server): switching Codex accounts releases the old account's writ…
juliusmarminge Nov 27, 2026
f6e19ae
fix(web): an archive made from . lists its files at the root (#44005)
iamshadmantaqi Nov 27, 2026
bb312b1
fix(client-runtime): keep tiny nonzero numbers in JSON tool output (#…
jadelike-wine Nov 27, 2026
e0fd8f6
fix(server): resolve favicons with angle brackets in quoted attribute…
jadelike-wine Nov 27, 2026
0404f70
feat(files): unlock password-protected previews (#44008)
Yash-Singh1 Nov 27, 2026
07b8554
fix(desktop): agent typing reaches cross-site frames in an unfocused …
juliusmarminge Nov 27, 2026
985d59e
fix(server): preserve line breaks around EPUB main content (#44013)
jadelike-wine Nov 27, 2026
3436f5f
fix(source-control): SCP-style remotes with a leading slash keep thei…
only21mil Nov 27, 2026
b312bc3
fix(web): minimap marks stay distinct in very long conversations (#44…
juliusmarminge Nov 27, 2026
351c9d1
fix(mobile): announce a single working subagent as one agent, not one…
saphid Nov 27, 2026
10efbcb
fix(i18n): tell Russian users to stop all threads sharing an agent pr…
saphid Nov 27, 2026
d3aa2dd
fix(server): recover dropped T3 MCP screenshot and snapshot outputs i…
matthewcosier Nov 27, 2026
aee6cf5
perf(server): run-filtered turn-item reads no longer walk a long thre…
AymanKhan9 Nov 27, 2026
f22ff00
feat(epub): add captions and read-along narration (#44015)
Yash-Singh1 Nov 27, 2026
1d90fe8
fix(server): limit workspace rescans after agent turns (#43969)
kavallaliw-art Nov 27, 2026
7b5c746
fix(web): keep literal alert markers in PR comment hover excerpts (#4…
saphid Nov 27, 2026
656a1ac
fix(web): "Keep both" copies named after a long theme file no longer …
only21mil Nov 27, 2026
c569992
fix(cli): avoid startup writes in t3 doctor dry runs (#44031)
jadelike-wine Nov 27, 2026
f0a2574
fix(shared): preserve terminal columns in saved notebook redraws (#44…
jadelike-wine Nov 27, 2026
a86ac01
fix(web): settings search finds the Your dictionary row by its displa…
saphid Nov 27, 2026
8810727
fix(web): Mark unread is not offered for a stopped run (#44026)
iamshadmantaqi Nov 27, 2026
958c26f
fix(pr): preview GitHub attachments by content type (#44042)
Yash-Singh1 Nov 27, 2026
ee38528
fix(web): long VS Code theme names no longer end in a broken emoji (#…
only21mil Nov 27, 2026
a1ea15e
fix(web): undoing an offline settle keeps the queued snooze (#44035)
iamshadmantaqi Nov 27, 2026
f4c5267
fix(web): use the ZIP directory's own modified date regardless of ent…
saphid Nov 27, 2026
8d31c3c
fix(server): stop retrying initial titles the provider refused (#44057)
juliusmarminge Nov 27, 2026
186f6aa
fix(web): issue tracker group headers stay on one line in a narrow li…
juliusmarminge Nov 27, 2026
a0ad0c6
fix(web): timeline rows update their spacing and setup collapse when …
AymanKhan9 Nov 27, 2026
65452f8
fix(cli): select the project registered at a symlink path (#44062)
jadelike-wine Nov 27, 2026
3d7512a
fix(web): copying chat text keeps each line break once (#44058)
iamshadmantaqi Nov 27, 2026
937ea89
fix(web): Enter on a *, + or numbered task item keeps its checkbox an…
AymanKhan9 Nov 27, 2026
dc37556
fix(server): workflow queue positions count only requests that can go…
saphid Nov 27, 2026
1f7cb36
fix(server): skip escaped whitespace rows in XLSX attachment text (#4…
jadelike-wine Nov 27, 2026
3fcfcae
fix(web): keybindings search finds a shortcut by its shown label (#44…
iamshadmantaqi Nov 27, 2026
c02bd2f
chore(sync): merge upstream t3code 3fcfcaee
shuv1337 Nov 27, 2026
caf9caa
fix(server): align cliCompileCache test with service-state recovery e…
shuv1337 Nov 27, 2026
9a3e729
fix(provider-core): drop stale versionAdvisory when running server ve…
shuv1337 Nov 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@t3tools/desktop",
"version": "0.1.12",
"version": "0.1.13",
"private": true,
"type": "module",
"main": "dist-electron/boot.cjs",
Expand Down
12 changes: 12 additions & 0 deletions apps/desktop/resources/installer.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
!else
${StrRep}
!define T3StrRep '${StrRep}'
Var t3AppWasRunning
!endif

!macro customAppRunningMessages
!ifndef BUILD_UNINSTALLER
StrCpy $t3AppWasRunning 1
!endif
Push $0
Push $1
${If} $IsPowerShellAvailable == 0
Expand Down Expand Up @@ -39,4 +43,12 @@
WinShell::SetLnkAUMI "$newStartMenuLink" "${APP_ID}"
${EndIf}
!endif

# The template relaunches after a silent install only with --force-run, which WinGet does not pass.
${If} ${Silent}
${AndIfNot} ${isForceRun}
${AndIf} $t3AppWasRunning == 1
HideWindow
${StdUtils.ExecShellAsUser} $0 "$launchLink" "open" ""
${EndIf}
!macroend
69 changes: 69 additions & 0 deletions apps/desktop/src/app/DesktopAppActivation.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// @effect-diagnostics nodeBuiltinImport:off -- This adapter test binds a real local socket or Windows named pipe and verifies its cleanup.
import * as NodeServices from "@effect/platform-node/NodeServices";
import * as NodeEvents from "node:events";
import * as NodeFSP from "node:fs/promises";
import * as NodeNet from "node:net";
import * as NodeOS from "node:os";
Expand All @@ -14,9 +16,15 @@ import { resolveDesktopAppControlAddress } from "@t3tools/shared/desktopAppContr
import * as HostProcess from "@t3tools/shared/HostProcess";
import { it } from "@effect/vitest";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import { afterEach, describe, expect } from "vite-plus/test";

import * as ElectronWindow from "../electron/ElectronWindow.ts";
import { DESKTOP_APP_ACTIVATION_REQUEST_CHANNEL } from "../ipc/channels.ts";
import * as DesktopWindow from "../window/DesktopWindow.ts";
import * as DesktopAppActivation from "./DesktopAppActivation.ts";
import { startDesktopAppControlServer } from "./DesktopAppActivation.ts";
import * as DesktopEnvironment from "./DesktopEnvironment.ts";

const openServers: Array<{ close: () => Promise<void> }> = [];

Expand Down Expand Up @@ -163,4 +171,65 @@ describe("desktop app control server", () => {
});
}),
);

it.effect("fails an in-flight request when the renderer process is gone", () =>
Effect.gen(function* () {
const platform = yield* HostProcess.Platform;
const userId = yield* HostProcess.UserId;
const root = yield* Effect.acquireRelease(
Effect.promise(() => NodeFSP.mkdtemp(NodePath.join(NodeOS.tmpdir(), "t3-app-crash-test-"))),
(dir) => Effect.promise(() => NodeFSP.rm(dir, { recursive: true, force: true })),
);
const stateDir = NodePath.join(root, "userdata");
const target = makeTarget(stateDir, platform, userId);

let resolveDispatched: () => void = () => undefined;
const dispatched = new Promise<void>((resolve) => {
resolveDispatched = resolve;
});
const webContents = Object.assign(new NodeEvents.EventEmitter(), {
isDestroyed: () => false,
send: (channel: string) => {
if (channel === DESKTOP_APP_ACTIVATION_REQUEST_CHANNEL) resolveDispatched();
},
});

const layer = DesktopAppActivation.layer.pipe(
Layer.provide(
Layer.succeed(DesktopEnvironment.DesktopEnvironment, {
stateDir,
platform,
} as unknown as DesktopEnvironment.DesktopEnvironment["Service"]),
),
Layer.provide(
Layer.succeed(DesktopWindow.DesktopWindow, {
activate: Effect.void,
} as unknown as DesktopWindow.DesktopWindow["Service"]),
),
Layer.provide(
Layer.succeed(ElectronWindow.ElectronWindow, {
main: Effect.succeedSome({ webContents } as unknown as Electron.BrowserWindow),
} as unknown as ElectronWindow.ElectronWindow["Service"]),
),
Layer.provide(NodeServices.layer),
);

yield* Effect.gen(function* () {
const activation = yield* DesktopAppActivation.DesktopAppActivation;
yield* activation.start;
yield* activation.setRendererReady(true);

const response = exchange(target.address, request("before-crash", platform));
yield* Effect.promise(() => dispatched);
webContents.emit("render-process-gone", {}, { reason: "crashed", exitCode: 1 });

expect(yield* Effect.promise(() => response)).toMatchObject({
ok: false,
requestId: "before-crash",
code: "renderer-unavailable",
});
expect(webContents.listenerCount("render-process-gone")).toBe(0);
}).pipe(Effect.provide(layer));
}).pipe(Effect.scoped),
);
});
2 changes: 2 additions & 0 deletions apps/desktop/src/app/DesktopAppActivation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,11 @@ export const make = Effect.gen(function* () {
if (event.isMainFrame && !event.isSameDocument) clearRegisteredRenderer();
};
webContents.on("did-start-navigation", onNavigation);
webContents.on("render-process-gone", onUnavailable);
webContents.once("destroyed", onUnavailable);
detachRendererListeners = () => {
webContents.removeListener("did-start-navigation", onNavigation);
webContents.removeListener("render-process-gone", onUnavailable);
webContents.removeListener("destroyed", onUnavailable);
};
}
Expand Down
5 changes: 3 additions & 2 deletions apps/desktop/src/app/DesktopCliShim.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ const fakeAppImage = (canMount = true, app = REPORTER) => {
`if [ "$1" = --appimage-extract ]; then cp -R '${image}' squashfs-root; exit 0; fi`,
'[ "$1" = --appimage-mount ] || exit 9',
'[ -n "$APPIMAGE_EXTRACT_AND_RUN" ] && exit 8',
`echo $$ >'${root}/mounter.pid'`,
canMount ? `echo '${image}'` : 'echo "Cannot mount AppImage"; exit 1',
// Like the FUSE runtime, any of these unmounts. fd 3 reports to the test when it is open.
// Trapped before the mount is announced, or the test's probe can arrive first and be lost.
"trap 'echo unmounted >&3 2>/dev/null; exit 0' TERM HUP INT",
"trap 'echo mounted >&3 2>/dev/null' WINCH",
`echo $$ >'${root}/mounter.pid'`,
canMount ? `echo '${image}'` : 'echo "Cannot mount AppImage"; exit 1',
"while :; do sleep 0.05; done",
"",
].join("\n"),
Expand Down
Loading
Loading