@coffeexdev/xmtp 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/channel.ts +14 -7
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -508,13 +508,20 @@ export const xmtpPlugin: ChannelPlugin<ResolvedXmtpAccount> = {
|
|
|
508
508
|
|
|
509
509
|
ctx.log?.info(`[${account.accountId}] XMTP provider started (address: ${bus.getAddress()})`);
|
|
510
510
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
511
|
+
// Block until abortSignal fires — OpenClaw treats a resolved startAccount
|
|
512
|
+
// as "provider exited" and triggers auto-restart with backoff.
|
|
513
|
+
await new Promise<void>((resolve) => {
|
|
514
|
+
if (ctx.abortSignal?.aborted) {
|
|
515
|
+
resolve();
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
const onAbort = () => resolve();
|
|
519
|
+
ctx.abortSignal?.addEventListener("abort", onAbort, { once: true });
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
await bus.close();
|
|
523
|
+
activeBuses.delete(account.accountId);
|
|
524
|
+
ctx.log?.info(`[${account.accountId}] XMTP provider stopped`);
|
|
518
525
|
},
|
|
519
526
|
},
|
|
520
527
|
};
|