Skip to content

Commit 50e7527

Browse files
committed
debug commit
1 parent e11560d commit 50e7527

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

components/dashboard/src/service/public-api.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,27 @@ export const organizationClient = createServiceClient(
4646
"organization",
4747
);
4848

49+
// @ts-ignore
50+
window.$testWorkspaceClient = workspaceClient;
51+
52+
// @ts-ignore
53+
window.$testWatch = (workspaceId: string) => {
54+
const abortController = new AbortController();
55+
const it = workspaceClient.watchWorkspaceStatus(
56+
{ workspaceId },
57+
{
58+
signal: abortController.signal,
59+
},
60+
);
61+
const startWatchWorkspace = async () => {
62+
for await (const workspace of it) {
63+
console.log("rcv", workspaceId, JSON.stringify(workspace));
64+
}
65+
};
66+
startWatchWorkspace().then().catch(console.error);
67+
return abortController.abort.bind(abortController);
68+
};
69+
4970
export async function listAllProjects(opts: { orgId: string }): Promise<ProtocolProject[]> {
5071
let pagination = {
5172
page: 1,

components/server/src/workspace/workspace-service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,10 @@ export class WorkspaceService {
739739
const dispose = this.subscriber.listenForWorkspaceInstanceUpdates(userId, (_ctx, instance) => {
740740
sink.next(instance);
741741
});
742-
return dispose.dispose;
742+
return () => {
743+
console.log("=============dispose");
744+
dispose.dispose();
745+
};
743746
}, opts);
744747
}
745748

0 commit comments

Comments
 (0)