Skip to content

[Web] Auth WS reconnection race condition & async Promise constructor anti-pattern #390

@Flegma

Description

@Flegma

Summary

Auth flow has a race condition during WebSocket reconnection and uses an error-prone pattern.

Findings

  • AuthStore — hardcoded 10-second timeout may fire before WebSocket connects. Subscription never stored for cleanup.
  • AuthStore — new Promise(async (resolve) => {...}) anti-pattern can swallow rejections.

Impact

Auth flow can fail intermittently. Promise rejections may go unhandled.

Suggested Fix

Replace new Promise(async ...) with proper async/await. Store subscription reference. Make timeout configurable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions