Hi team,
We discovered a critical bug in the @heygen/liveavatar-web-sdk (v0.0.11). The keepAlive() method inside the LiveAvatarSession class is missing an await or return before calling the underlying sessionClient.keepAlive().
The exact code in index.esm.js (line ~821):
keepAlive() {
return __awaiter$1(this, void 0, void 0, function* () {
if (!this.assertConnected()) {
return;
}
try {
this.sessionClient.keepAlive(); // <--- BUG: Missing 'yield' or 'await'
}
catch (error) {
// This catch block is never reached if the HTTP request fails
console.error("Session keep alive error on server:", error);
throw error;
}
});
}
Impact: Because it is not awaited, any failure from the backend (like returning a 400 Bad Request: Session already closed) escapes the try-catch block entirely. This results in an Uncaught (in promise) SessionApiError in the browser console, which crashes our frontend application state and makes it impossible for developers to gracefully handle disconnected sessions or reconnect logic.
Proposed fix: Please change it to yield this.sessionClient.keepAlive(); (if compiled to generators) or await this.sessionClient.keepAlive(); so the try-catch block actually works as intended.
Hi team,
We discovered a critical bug in the
@heygen/liveavatar-web-sdk(v0.0.11). ThekeepAlive()method inside theLiveAvatarSessionclass is missing anawaitorreturnbefore calling the underlyingsessionClient.keepAlive().The exact code in
index.esm.js(line ~821):Impact: Because it is not awaited, any failure from the backend (like returning a 400 Bad Request: Session already closed) escapes the try-catch block entirely. This results in an Uncaught (in promise) SessionApiError in the browser console, which crashes our frontend application state and makes it impossible for developers to gracefully handle disconnected sessions or reconnect logic.
Proposed fix: Please change it to yield this.sessionClient.keepAlive(); (if compiled to generators) or await this.sessionClient.keepAlive(); so the try-catch block actually works as intended.