Skip to content

fix: health check timeout causes unhandled promise rejection #1755

@kaizhou-lab

Description

@kaizhou-lab

Problem

Sentry issue ELECTRON-P — 105 occurrences.

In ModelModalContent.tsx, the health check creates a responsePromise with a 30s timeout. If the timeout fires while sendMessage.invoke() is still pending, the rejection is unhandled because await responsePromise hasn't been reached yet.

Root Cause

Race condition: responsePromise rejects (timeout) → but await responsePromise at line 311 hasn't been reached yet because await sendMessage.invoke() at line 304 is still in progress → unhandled promise rejection.

Fix

Add responsePromise.catch(() => {}) immediately after creation to mark the rejection as handled. The actual error is still caught by await responsePromise in the outer try-catch.

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