Conversation
Probably should test this with a real app before making the claim of web compatibility, but I'm just getting started with supabase and don't have an app to test it on yet. I've made a similar change in another library using websocket_channel so I'm fairly confident it will work though. Edit: |
Hi @TimWhiting I pushed a fix related to channel subscription. Can you merge with the Thanks for the websocket update 👍 |
@phamhieu |
Also tested it. Thanks for the new realtime example code in the supabase package. I noticed however that the olds field in the SupabaseRealtimePayload always has null for all columns in the table except the id on a DELETE. Is that expected? |
yes, that's right. Only record ID is available for a delete event. |
The code looks good to me 👍 I will merge this PR after you fix the conflicts. Thank you. |
@phamhieu |
What kind of change does this PR introduce?
This change introduces an indirection in creating the default websocket to allow for web compatibility
What is the current behavior?
Web doesn't work unless you create a realtime client directly with the HtmlWebSocketChannel. Web support is missing on pub.dev in both
supabase
andrealtime_client
Example error:
Socket error: Unsupported operation: Platform._version
What is the new behavior?
No new behavior except for the web
Additional context
https://dart.dev/guides/libraries/create-library-packages#conditionally-importing-and-exporting-library-files