thingsboard / dart_thingsboard_client

ThingsBoard API client library for Dart developers.
BSD 3-Clause "New" or "Revised" License
59 stars 30 forks source link

Fix problem with websocket and loosing internet #14

Closed benoit-rolandeau-act closed 8 months ago

benoit-rolandeau-act commented 1 year ago

As described in the issue: #13, the app crashes when we are using the websocket and we loose internet.

A fix recommendation was given in the source lib, but it forces to have asynchronous method. But here, all the methods are synchronous (which is not great).

The ideal way will be to change all the method from synchronous to asynchronous, but I think that will change a lot of things.

Therefore, I simply redirect the onError returns from the future to the _onError callback

ikulikov commented 8 months ago

@benoit-rolandeau-act Thx for your contribution! Your fix was improved and was commited to master: see de8aff622af141494f3f8ff860e233ed4f532f56