zino-hofmann / graphql-flutter

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
https://zino-hofmann.github.io/graphql-flutter
MIT License
3.25k stars 622 forks source link

[WebsocketClient] onConnectionLost() not called when autoRecconect is false #1426

Open ykuc7 opened 7 months ago

ykuc7 commented 7 months ago

I tried a graphql pachage in Websocket.

In onConnectionLost()

    if (_isReconnectionPaused ||
        !config.autoReconnect || // <------------ this case
        _connectionStateController.isClosed ||
        _wasDisposed) {
      return;
    }

    var duration = config.delayBetweenReconnectionAttempts ?? Duration.zero;
    if (config.onConnectionLost != null) {
      duration = (await config.onConnectionLost!(code, reason)) ?? duration;
    }

config.onConnectionLost() not called when autoRecconect is false.

Is this a bug? Or does it mean something?

WieFel commented 2 months ago

+1