Skip to content

[Bug] Handle server-initiated WebSocket closes without reconnecting #103

Description

@GregHolmes

Summary

A server-initiated WebSocket close does not reliably notify onDisconnected, and non-1000 closes are treated as reconnectable. Flux STT closes after CloseStream with no status (observed as 1005), so applications that wait for the server close can hang or reconnect instead of terminating.

Affected version

0.10.0

Evidence

src/main/java/com/deepgram/core/ReconnectingWebSocketListener.java implements onClosed(...) but not onClosing(...); it calls scheduleReconnect() for every code other than 1000. The class is Fern-generated but temporarily frozen for existing reconnect fixes.

Expected behavior

A server close should result in one onDisconnected callback and should not reconnect when the protocol session has ended.

Acceptance criteria

  • Server-initiated close reaches the public onDisconnected handler without an explicit client disconnect().
  • A no-status/1005 close after Flux CloseStream does not reconnect.
  • Reconnect behavior remains available for actual transport failures.
  • Add a MockWebServer regression test.
  • Preserve the .fernignore freeze and report the generator gap upstream.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions