fix: address review feedback — handle start failure, remove placeholder URL

- Don't mark client as started if client.start() errors during init
- Remove placeholder issue URL from comment
This commit is contained in:
efe-arv
2026-03-02 01:35:39 +03:00
committed by Peter Steinberger
parent f66f563c1a
commit 8884f99c92

View File

@@ -85,15 +85,18 @@ async function ensureSharedClientStarted(params: {
}
// bot-sdk start() returns a promise that never resolves (infinite sync loop).
// Fire-and-forget: the sync loop runs, events fire on the client,
// but we must not await or the entire provider startup hangs.
// See: https://github.com/openclaw/openclaw/issues/NEW
// Fire-and-forget: the sync loop runs and events fire on the client,
// but we must not await or the entire provider startup hangs forever.
let startFailed = false;
client.start().catch((err: unknown) => {
startFailed = true;
LogService.error("MatrixClientLite", "client.start() error:", err);
});
// Give the sync loop a moment to initialize
// Give the sync loop a moment to initialize before marking ready
await new Promise(resolve => setTimeout(resolve, 2000));
params.state.started = true;
if (!startFailed) {
params.state.started = true;
}
})();
sharedClientStartPromises.set(key, startPromise);
try {