Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript error on laptop sleep only in release web build #97

Open
DmitrySikorsky opened this issue Feb 6, 2023 · 2 comments
Open

Comments

@DmitrySikorsky
Copy link

DmitrySikorsky commented Feb 6, 2023

Hi! Thank you for your package, it is very useful.

But I have a strange problem. When I sleep my laptop, after that websocket fails to reconnect with JavaScript exception:

image

If I click the first line I will see this code:

image

So I think the problem is in this function:

https://github.com/jamiewest/signalr_core/blob/main/lib/src/hub_connection.dart#L383

But if I build the web app like

flutter build web --profile --source-maps

everything works, websocket is reconnected without problems.

At the same time, reconnection works well if I just put the app without interactions, Chrome will reduce setInterval time, and server kills the connection. But if the laptop gets sleep, after that reconnection always fail on release build.

Flutter 3.7.0, package version is 1.1.1.

@DmitrySikorsky
Copy link
Author

So, this is really very strange. But I copied your package locally and changed the hub_connection.dart file a little bit.

I only changed the _completeClose function's parameter name to exception1, and the _reconnect function's parameter name to exception2, and now everything works.

I will appreciate if you could find time and release an update that will fix this weird bug that is related, how I think, to JavaScript minification process.

@felimuti
Copy link

Hi, I've the same issue. Any news on a new update release to fix this? @jamiewest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants