- fix: catch
SocketException
#62
- fix: export realtime presence #60
- fix: bug where leaving existing topic throws #58
- chore: v1.0.0 release 🚀
- fix: set minimum Dart SDK to 2.14.0 #56
- fix: sends null for access_token when not signed in #53
- fix: bug where it throws exception when listening to postgres changes on old version of realtime server
- chore: add mock tests for listening to postgres changes
- BREAKING: fix payload shape on old version of realtime server to match the new version
- fix: bug where presence sync of other clients causes exception
- feat: add support for broadcast and presence
- BREAKING:
.on()
no longer takes a event string (e.g. INSERT, UPDATE or DELETE), but takes RealtimeListenTypes
and a ChannelFilter
final socket = RealtimeClient('ws://SUPABASE_API_ENDPOINT/realtime/v1');
final channel = socket.channel('can_be_any_string');
// listen to insert events on public.messages table
channel.on(
RealtimeListenTypes.postgresChanges,
ChannelFilter(
event: 'INSERT',
schema: 'public',
table: 'messages',
), (payload, [ref]) {
print('database insert payload: $payload');
});
// listen to `location` broadcast events
channel.on(
RealtimeListenTypes.broadcast,
ChannelFilter(
event: 'location',
), (payload, [ref]) {
print(payload);
});
// send `location` broadcast events
channel.send(
type: RealtimeListenTypes.broadcast,
event: 'location',
payload: {'lat': 1.3521, 'lng': 103.8198},
);
// listen to presence states
channel.on(RealtimeListenTypes.presence, ChannelFilter(event: 'sync'),
(payload, [ref]) {
print(payload);
print(channel.presenceState());
});
// subscribe to the above changes
channel.subscribe((status) async {
if (status == 'SUBSCRIBED') {
// if subscribed successfully, send presence event
final status = await channel.track({'user_id': myUserId});
}
});
- fix: allow null access token to be passed
- fix: use toString() instead of type cast error response
- feat: add setAuth to send user Access Token to Realtime Server
- fix: don't apply toString() to json
- fix: parsing bug of boolean values on WALRUS
- feat: update transformers to accept already transformed walrus changes
- chore: added X-Client-Info header
- fix: converted
Callback
from typedef` to function types
- fix: bug where array value is not properly emitted
- fix: add strict typing to
convertChangeData()
- fix: heartbeatTimer not cancelled upon calling
socket.disconnect()
- fix: getting value from received response map
- fix: bug where unsubscribe from '*' type subscription throws exception
- fix: timeout timer not starting
- refactor: rename Column class to PostgresColumn
- fix: subscription type '*' does not fire callback bug
- fix: converted typedefs in
RealtimeClient
to function types
- fix: heartbeat event name
- fix: default reconnectAfterMs function throws RangeError
- chore: update mocktail version
- fix: RetryTimer
_tries
is not initialized
- fix: transformers.convertColumn method
- fix: convertChangeData.columns type to List<Map<String, dynamic>>
- fix: binding filter bug on realtimeSubscription trigger method
- chore: replace
Map
with Map<String, dyanmic>
- tidy up
- chore: update README
- fix: convertChangeData columns param type
- fix: transformers convertChangeData method
- Rename
socket
to RealtimeClient
- Rename
channel
to RealtimeSubscription
- Update README Usage with more examples
- Update package description