Skip to content

pgflow 0.7.3: Improved Supabase Realtime Connection Reliability

pgflow 0.7.3 introduces a configurable realtimeStabilizationDelayMs option that addresses a known Supabase Realtime limitation where backend routing isn’t fully established when the SUBSCRIBED event is emitted.

The TypeScript client now includes a realtimeStabilizationDelayMs configuration option (default: 300ms) that adds a delay after subscribing to Realtime channels. This works around a known Supabase Realtime issue where messages sent immediately after subscription confirmation may be missed because backend routing takes additional time to fully establish.

When starting flows or retrieving runs, the client waits for this stabilization period after receiving the SUBSCRIBED event, ensuring that all subsequent realtime events are properly received.

The default 300ms delay works reliably in most environments. If you experience missed events or connection issues, increase the delay to 400-500ms:

import { PgflowClient } from '@pgflow/client';
// Increase stabilization delay for unreliable connections
const pgflow = new PgflowClient(supabase, {
realtimeStabilizationDelayMs: 400,
});

You can also disable the delay by setting it to 0, though this may cause missed events in some environments:

// Disable delay (may cause missed events)
const pgflow = new PgflowClient(supabase, {
realtimeStabilizationDelayMs: 0,
});

See the TypeScript Client documentation and PgflowClient API reference for complete details.

Follow the update guide to upgrade your @pgflow/client dependency to 0.7.3.


Questions or issues? Join our Discord community or open an issue on GitHub.

Chat with Author