mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-14 10:39:32 +01:00
fix(discord): keep the thread of a discarded rebuild, close one made for a closed tab, unique tmp names, wider prune keep set
This commit is contained in:
1 parent
b68792f988
commit
a698729fb6
6 files changed
+94
-10
No files matched your search
+11
-3
@@ -3261,7 +3261,14 @@ export class WebServer extends EventEmitter {
|
||||
await this.finalizeRestoredState(restored);
|
||||
void this.discordBridge
|
||||
.release()
|
||||
.then(() => this.discordBridge.prune(this.sessions.keys()))
|
||||
.then(() =>
|
||||
// Same keep set as the agent inbox prune: a reboot-restore rebuild reuses the old id.
|
||||
this.discordBridge.prune([
|
||||
...this.sessions.keys(),
|
||||
...Object.keys(this.store.getSessions()),
|
||||
...rebootRestoreRegistry.list(() => true).map((entry) => entry.sessionId),
|
||||
])
|
||||
)
|
||||
.catch(() => undefined);
|
||||
|
||||
// Instance-scoped reaper: after restore, `docker rm -f` managed containers of
|
||||
@@ -3847,8 +3854,9 @@ export class WebServer extends EventEmitter {
|
||||
} catch (err) {
|
||||
console.warn(`[Server] releasing the tab layout slot failed: ${getErrorMessage(err)}`);
|
||||
}
|
||||
// A half-built session never had a thread, but its per-tab bridge state goes with it.
|
||||
void this.discordBridge.sessionDeleted(sessionId).catch(() => undefined);
|
||||
// Per-tab bridge state only: a reboot-restore rebuild reuses the old id and stays on offer for a
|
||||
// retry, so its thread must survive the discard.
|
||||
this.discordBridge.forgetTab(sessionId);
|
||||
// Any `session:updated` the half-built session emitted before it failed left a
|
||||
// tab on every other open board, and the client's handler is an upsert.
|
||||
this.broadcast(SseEvent.SessionDeleted, { id: sessionId });
|
||||
|
||||
Reference in new issue
Block a user