Skip to content

An open-source, self-hosted system for apps built with web technologies.

Unload Program frames when closing

zohayrslilehd9a70fda7754
diff --git a/source/client/core/link-manager/auth-manager/process-manager/process.ts b/source/client/core/link-manager/auth-manager/process-manager/process.ts
index 27b899b..099fc59 100644
--- a/source/client/core/link-manager/auth-manager/process-manager/process.ts
+++ b/source/client/core/link-manager/auth-manager/process-manager/process.ts
@@ -67,9 +67,9 @@ export default class Process {
}
// Ending is asked for; the process leaves when its exit echoes.
- public async stop() {
+ public async exit() {
- await this.processManager.$outbound.publish("/stop", this.identity)
+ await this.processManager.$outbound.publish("/exit", this.identity)
}
// The program's own words, to its other half.
diff --git a/source/client/view/desktop/client-host/host.ts b/source/client/view/desktop/client-host/host.ts
index 626b864..3c5be45 100644
--- a/source/client/view/desktop/client-host/host.ts
+++ b/source/client/view/desktop/client-host/host.ts
@@ -593,7 +593,7 @@ export default function host(authManager: AuthManager, pane: string, desktop: ()
if (word === "exit") {
- await scope.sibling(args[0]).stop()
+ await scope.sibling(args[0]).exit()
return [pane]
}
diff --git a/source/client/view/desktop/window-manager/process-window.tsx b/source/client/view/desktop/window-manager/process-window.tsx
index 763838f..2c77b9c 100644
--- a/source/client/view/desktop/window-manager/process-window.tsx
+++ b/source/client/view/desktop/window-manager/process-window.tsx
@@ -160,7 +160,7 @@ export default memo(function ({ identity, record, client, title, icon, position,
cannot reach the desktop document or its authorization. Its
channel crosses through postMessage and resolves identity from
this frame, so isolation does not weaken communication. */}
- {!closing && <ProgramFrame
+ {!stopping && !closing && <ProgramFrame
record={record}
diff --git a/source/client/view/desktop/window-manager/window-manager.ts b/source/client/view/desktop/window-manager/window-manager.ts
index 5f91e23..c98f0df 100644
--- a/source/client/view/desktop/window-manager/window-manager.ts
+++ b/source/client/view/desktop/window-manager/window-manager.ts
@@ -199,7 +199,7 @@ export default function useWindows() {
redrawStopping(revision => revision + 1)
- process.stop().catch(() => {
+ process.exit().catch(() => {
stopping.current.delete(process.identity)
diff --git a/source/client/view/desktop/window-manager/window.tsx b/source/client/view/desktop/window-manager/window.tsx
index 8afa136..c5a8b0a 100644
--- a/source/client/view/desktop/window-manager/window.tsx
+++ b/source/client/view/desktop/window-manager/window.tsx
@@ -629,7 +629,7 @@ export default function ({ title, icon, children, onClose, onClosed, onMinimize,
onClose={onClose}
- stopping={stopping}
+ stopping={stopping || closing}
/>}
diff --git a/source/server/core/link-manager/auth-manager/process-manager/process-manager.ts b/source/server/core/link-manager/auth-manager/process-manager/process-manager.ts
index cb33c18..7bd97be 100644
--- a/source/server/core/link-manager/auth-manager/process-manager/process-manager.ts
+++ b/source/server/core/link-manager/auth-manager/process-manager/process-manager.ts
@@ -972,7 +972,7 @@ export default class ProcessManager extends TheLink {
const ended = [...this.processes.values()].filter(entry => entry.program === owner).map(entry => entry.identity)
- for (const identity of [...ended.filter(identity => identity !== asker), ...ended.filter(identity => identity === asker)]) await this.stop(identity)
+ for (const identity of [...ended.filter(identity => identity !== asker), ...ended.filter(identity => identity === asker)]) await this.exit(identity)
return ended
}
@@ -1697,7 +1697,7 @@ export default class ProcessManager extends TheLink {
const target = this.heldProcess(rest[0], process)
- await this.stop(target.identity)
+ await this.exit(target.identity)
return [target.identity]
}
@@ -2077,8 +2077,8 @@ export default class ProcessManager extends TheLink {
await this.publish(identity, "client", identity, "server", values)
}
- @Connect("/stop")
- public async stop(identity: string) {
+ @Connect("/exit")
+ public async exit(identity: string) {
return await this.exitProcess(identity)
}
diff --git a/source/server/core/link-manager/auth-manager/process-manager/process.ts b/source/server/core/link-manager/auth-manager/process-manager/process.ts
index 710f2cc..f92b7f2 100644
--- a/source/server/core/link-manager/auth-manager/process-manager/process.ts
+++ b/source/server/core/link-manager/auth-manager/process-manager/process.ts
@@ -191,7 +191,7 @@ export default class Process {
}
/** Internal aggregate exit used by lifecycle owners and focused probes. */
- public async stop() {
+ public async exit() {
if (!this.exitProcess) throw new Error("This Process has no lifecycle owner")
diff --git a/source/server/core/wallpaper-manager.ts b/source/server/core/wallpaper-manager.ts
index 272c64f..e6ff876 100644
--- a/source/server/core/wallpaper-manager.ts
+++ b/source/server/core/wallpaper-manager.ts
@@ -183,7 +183,7 @@ export default class WallpaperManager {
if (process.client?.window.layer !== "wallpaper") continue
- await process.stop()
+ await process.exit()
}
}
diff --git a/source/server/view/intake.ts b/source/server/view/intake.ts
index 8545364..09a1747 100644
--- a/source/server/view/intake.ts
+++ b/source/server/view/intake.ts
@@ -107,7 +107,7 @@ export default function intake(application: Application, path: string) {
for (const identity of attached) {
- application.linkManager.authManager.processManager.stop(identity).catch(() => undefined)
+ application.linkManager.authManager.processManager.exit(identity).catch(() => undefined)
}
attached.clear()
@@ -284,7 +284,7 @@ async function answer(application: Application, attached: Set<string>, say: (eve
if (!alive()) {
- if (application.linkManager.authManager.processManager.processes.has(identity)) await application.linkManager.authManager.processManager.stop(identity)
+ if (application.linkManager.authManager.processManager.processes.has(identity)) await application.linkManager.authManager.processManager.exit(identity)
return
}