Archived
feat(sessions): add daemon notification inbox protocol
This commit is contained in:
@@ -26,6 +26,16 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe("federated route contract", () => {
|
||||
it("allowlists notification HTTP routes without adding a notification WebSocket", () => {
|
||||
expect(FEDERATED_HTTP_ROUTES.filter((route) => route.path.includes("notifications"))).toEqual([
|
||||
{ method: "GET", path: "/sessions/notifications" },
|
||||
{ method: "GET", path: "/sessions/:sessionId/notifications" },
|
||||
{ method: "POST", path: "/sessions/:sessionId/notifications/dismiss" },
|
||||
{ method: "POST", path: "/sessions/:sessionId/notifications/dismiss-all" },
|
||||
]);
|
||||
expect(FEDERATED_WEBSOCKET_ROUTES.some((path) => path.includes("notifications"))).toBe(false);
|
||||
});
|
||||
|
||||
it("covers machine-scoped client HTTP calls with remote proxy routes", async () => {
|
||||
const fetchMock = vi.fn<FetchLike>(() => Promise.resolve(jsonResponse({})));
|
||||
vi.stubGlobal("fetch", fetchMock);
|
||||
|
||||
@@ -104,7 +104,7 @@ export class SessionController {
|
||||
if (event.type === "status.update") this.queueStatusUpdate(event.status);
|
||||
else if (event.type === "activity.update") this.queueActivityUpdate(event.activity);
|
||||
else if (event.type === "session.created") this.applyCreatedSession(event.session);
|
||||
else this.applySessionName(event.sessionId, event.name);
|
||||
else if (event.type === "session.name") this.applySessionName(event.sessionId, event.name);
|
||||
}
|
||||
|
||||
dispose() {
|
||||
|
||||
Reference in New Issue
Block a user