Skip to content

Commit 456943e

Browse files
patuwwya-tylenda
authored andcommitted
Fix dropping STH by id
1 parent f516c81 commit 456943e

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

packages/cli/src/lib/commands/space.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ export const space: CommandDefinition = (program) => {
8686
.argument("<space_name>", "The name of the Space")
8787
.option("--id <id>", "Hub Id")
8888
.option("--all", "Disconnects all self-hosted Hubs connected to Space", false)
89-
.action(async (spaceName: string, id: string, all: string) => {
89+
.action(async (spaceName: string, options: { id: string, all: boolean }) => {
9090
const mwClient = getMiddlewareClient();
9191
const managerClient = mwClient.getManagerClient(spaceName);
9292
let opts = { } as PostDisconnectPayload;
9393

94-
if (typeof id === "string") {
95-
opts = { id };
94+
if (typeof options.id === "string") {
95+
opts = { id: options.id };
9696
}
9797

98-
if (all) {
98+
if (options.all) {
9999
opts = { limit: 0 };
100100
}
101101

packages/host/src/lib/cpm-connector.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,6 @@ export class CPMConnector extends TypedEmitter<Events> {
295295
[CPMMessageCode.NETWORK_INFO, await this.getNetworkInfo()]
296296
);
297297

298-
299-
300-
301298
this.emit("connect");
302299

303300
return new Promise((resolve, reject) => {
@@ -344,7 +341,8 @@ export class CPMConnector extends TypedEmitter<Events> {
344341

345342
connection.socket
346343
.once("close", async () => {
347-
this.logger.warn("CLOSE STATUS", connection.res.statusCode)
344+
this.logger.warn("CLOSE STATUS", connection.res.statusCode);
345+
348346
await this.handleConnectionClose(connection.res.statusCode || -1);
349347
});
350348
} catch (error: any) {

0 commit comments

Comments
 (0)