Skip to content

feat(realtime): Move reconnect logic inside module

Fabio Alessandrelli requested to merge fales/w4gd:feat/realtime_reconnect into main

Move the reconnection logic from w4gd to the supabase/realtime module.

Adds the following options to the supabase realtime module:

  • reconnect_enabled: Enable the reconnection feature.
  • reconnect_max_retries: Defines the maximum amount of retries allowed when trying to reconnect.
  • reconnect_backoff: Defines the base backoff time between retries. Note: The final backoff will be reconnect_backoff * pow(2, retry).

Move the realtime autoconnect logic from W4Client to W4GD, and adds a disconnect_from_realtime method to manually disconnect from realtime (with proper warnings in the documentation).

Better sanitize URL in supabase client, and correctly handle empty URL in realtime connect_socket function.

Edited by Fabio Alessandrelli

Merge request reports

Loading