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

fix: Remove error parameter on _triggerChanError #637

Merged
merged 3 commits into from
Sep 20, 2023
Merged

Conversation

dshukertjr
Copy link
Member

What kind of change does this PR introduce?

Bug fix.

What is the current behavior?

When the device is offline, SocketExceptions and WebSocketExceptions gets thrown by the websocket connection stream here. This was causing rapid errors to be passed to the .subscribe() callback, and therefore causing rapid errors to be thrown when listening to data changes using .stream() method.

What is the new behavior?

The errors from the web socket connection is not passed to _triggerChanError, which is aligned with the js SDK https://github.com/supabase/realtime-js/blob/master/src/RealtimeClient.ts#L402

Additional context

This PR reverts some of the work done in https://github.com/supabase/realtime-dart/pull/62/files, but we can default to the same behavior as the js SDK for now and fix things if necessary in the future.

@dshukertjr dshukertjr merged commit c4291c9 into main Sep 20, 2023
10 checks passed
@dshukertjr dshukertjr deleted the fix/realtime-close branch September 20, 2023 08:30
@coolusaHD
Copy link

@dshukertjr Hey
I'm came accross theis PR while looking for a bugfix in my project.
I'm currently using the realtime function in my flutter app to retrieve live data. Currently when the devices loses connection I want to show th user that he is not connected to live data anymore.

I was using the onError function on the stream.listen() function.
With this update this no longer works.
As I am new to flutter I was wondering if you guys see any other way to get this behavior and help me a bit out ?

Thanks in advance. ✌️

@dshukertjr
Copy link
Member Author

@coolusaHD
Thanks for the commend. That is a good point. We would have to come up with a way to detect the connection state for when using .stream(). Would you be able to open a issue for this in this repo?

@coolusaHD
Copy link

@dshukertjr
See #674

Thanks

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

Successfully merging this pull request may close these issues.

3 participants