Skip to content

Commit c4291c9

Browse files
authored
fix: Remove error parameter on _triggerChanError (supabase#637)
* add docs to some SocketStates * fix: remove error parameter on _triggerChanError * add docs to SocketStates
1 parent e54169e commit c4291c9

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

packages/realtime_client/lib/src/constants.dart

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,22 @@ class Constants {
99
};
1010
}
1111

12-
enum SocketStates { connecting, open, closing, closed, disconnected }
12+
enum SocketStates {
13+
/// Client attempting to establish a connection
14+
connecting,
15+
16+
/// Connection is live and connected
17+
open,
18+
19+
/// Socket is closing.
20+
closing,
21+
22+
/// Socket being close not by the user. Realtime should attempt to reconnect.
23+
closed,
24+
25+
/// Socket being closed by the user
26+
disconnected,
27+
}
1328

1429
enum ChannelStates { closed, errored, joined, joining, leaving }
1530

packages/realtime_client/lib/src/realtime_client.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,15 +428,15 @@ class RealtimeClient {
428428

429429
void _onConnError(dynamic error) {
430430
log('transport', error.toString());
431-
_triggerChanError(error);
431+
_triggerChanError();
432432
for (final callback in stateChangeCallbacks['error']!) {
433433
callback(error);
434434
}
435435
}
436436

437-
void _triggerChanError([dynamic error]) {
437+
void _triggerChanError() {
438438
for (final channel in channels) {
439-
channel.trigger(ChannelEvents.error.eventName(), error);
439+
channel.trigger(ChannelEvents.error.eventName());
440440
}
441441
}
442442

0 commit comments

Comments
 (0)