Archived
fix(sessions): canonicalize notification route cwd
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { resolve } from "node:path";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { PiSessionService } from "./piSessionService.js";
|
||||
import { SessionNotificationStore } from "./sessionNotificationStore.js";
|
||||
@@ -29,7 +30,7 @@ describe("PiSessionService archive and cleanup", () => {
|
||||
});
|
||||
|
||||
await service.status(sessionRef("archive-notification-session"));
|
||||
const generation = store.currentGeneration("archive-notification-session", "/workspace");
|
||||
const generation = store.currentGeneration("archive-notification-session", resolve("/workspace"));
|
||||
if (generation === undefined) throw new Error("expected active notification generation");
|
||||
store.addNotification(generation, "archive me", "warning");
|
||||
|
||||
|
||||
@@ -944,7 +944,7 @@ describe("PiSessionService lifecycle, listing, and reload", () => {
|
||||
"shutdown before close failure",
|
||||
"prior",
|
||||
]);
|
||||
expect(store.currentGeneration("failed-close-reload", "/workspace")).toBeDefined();
|
||||
expect(store.currentGeneration("failed-close-reload", resolve("/workspace"))).toBeDefined();
|
||||
await service.stop(sessionRef("failed-close-reload"));
|
||||
await service.dispose();
|
||||
});
|
||||
|
||||
@@ -689,7 +689,7 @@ export class PiSessionService implements SessionRouteService {
|
||||
}
|
||||
|
||||
notificationInbox(ref: PiSessionRef): SessionNotificationInboxSnapshot {
|
||||
return this.notificationStore.inboxSnapshot(ref.id, ref.cwd);
|
||||
return this.notificationStore.inboxSnapshot(ref.id, canonicalizeStoredCwd(ref.cwd));
|
||||
}
|
||||
|
||||
dismissNotification(
|
||||
@@ -698,7 +698,7 @@ export class PiSessionService implements SessionRouteService {
|
||||
): SessionNotificationInboxSnapshot {
|
||||
const result = this.notificationStore.dismissNotification(
|
||||
ref.id,
|
||||
ref.cwd,
|
||||
canonicalizeStoredCwd(ref.cwd),
|
||||
request.daemonInstanceId,
|
||||
request.notificationId,
|
||||
);
|
||||
@@ -712,7 +712,7 @@ export class PiSessionService implements SessionRouteService {
|
||||
): SessionNotificationInboxSnapshot {
|
||||
const result = this.notificationStore.dismissAll(
|
||||
ref.id,
|
||||
ref.cwd,
|
||||
canonicalizeStoredCwd(ref.cwd),
|
||||
request.daemonInstanceId,
|
||||
request.throughOrder,
|
||||
request.throughOverflowWatermark,
|
||||
@@ -1692,7 +1692,7 @@ export class PiSessionService implements SessionRouteService {
|
||||
return;
|
||||
}
|
||||
if (isPiSessionRef(ref)) {
|
||||
this.publishNotificationMutations(this.notificationStore.clearSessionIdentity(ref.id, ref.cwd, "runtime-close"));
|
||||
this.publishNotificationMutations(this.notificationStore.clearSessionIdentity(ref.id, canonicalizeStoredCwd(ref.cwd), "runtime-close"));
|
||||
return;
|
||||
}
|
||||
await this.closeActive(ref);
|
||||
|
||||
Reference in New Issue
Block a user