-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Description
Describe the bug
Ndk takes really long for the first request with very high cpu usage
the problem is caused by
_stateStreamSubscription = _websocketDS.ws.connection.listen((state) {
Logger.log.t("${_websocketDS.url} connection state changed to $state");
if (state is Connected || state is Reconnected) {
if (!completer.isCompleted) {
completer.complete();
}
if (state is Reconnected && onReconnect != null) {
onReconnect.call();
}
} else if (state is Disconnected) {
completer = Completer();
ready = completer.future;
} else if (state is Connecting || state is Reconnecting) {
// Do nothing, just waiting for (re)connection to be established
} else {
Logger.log.w(
"${_websocketDS.url} connection state changed to unknown state: $state");
}
});
Because a callback is called the issue might be upstream.
Commenting this code resolves the issue but breaks future requests
I suspect a loop when relay is in connecting/reconnecting state causing the cpu spike
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed