Skip to content

[v0.0.11] BUG: Missing 'await' in LiveAvatarSession.keepAlive() causing Uncaught Promise Rejections #86

Description

@guidorietbroek

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions