@@ -23,7 +23,9 @@ describe('Flow Lifecycle Integration', () => {
2323 await sql `SELECT pgflow.add_step(${ testFlow . slug } , 'first_step')` ;
2424
2525 const supabaseClient = createTestSupabaseClient ( ) ;
26- const pgflowClient = new PgflowClient ( supabaseClient ) ;
26+ const pgflowClient = new PgflowClient ( supabaseClient , {
27+ realtimeStabilizationDelayMs : 1000 ,
28+ } ) ;
2729
2830 const input = { url : 'https://example.com' } ;
2931 const run = await pgflowClient . startFlow ( testFlow . slug , input ) ;
@@ -51,7 +53,9 @@ describe('Flow Lifecycle Integration', () => {
5153 await sql `SELECT pgflow.add_step(${ testFlow . slug } , 'step_two')` ;
5254
5355 const supabaseClient = createTestSupabaseClient ( ) ;
54- const pgflowClient = new PgflowClient ( supabaseClient ) ;
56+ const pgflowClient = new PgflowClient ( supabaseClient , {
57+ realtimeStabilizationDelayMs : 1000 ,
58+ } ) ;
5559
5660 const run = await pgflowClient . startFlow ( testFlow . slug , {
5761 data : 'test' ,
@@ -83,7 +87,9 @@ describe('Flow Lifecycle Integration', () => {
8387 await sql `SELECT pgflow.add_step(${ testFlow . slug } , 'step_two')` ;
8488
8589 const supabaseClient = createTestSupabaseClient ( ) ;
86- const pgflowClient = new PgflowClient ( supabaseClient ) ;
90+ const pgflowClient = new PgflowClient ( supabaseClient , {
91+ realtimeStabilizationDelayMs : 1000 ,
92+ } ) ;
8793
8894 const run = await pgflowClient . startFlow ( testFlow . slug , {
8995 data : 'consistency-test' ,
@@ -119,7 +125,9 @@ describe('Flow Lifecycle Integration', () => {
119125
120126 const sqlClient = new PgflowSqlClient ( sql ) ;
121127 const supabaseClient = createTestSupabaseClient ( ) ;
122- const pgflowClient = new PgflowClient ( supabaseClient ) ;
128+ const pgflowClient = new PgflowClient ( supabaseClient , {
129+ realtimeStabilizationDelayMs : 1000 ,
130+ } ) ;
123131
124132 const input = { data : 'lifecycle-test' } ;
125133 const run = await pgflowClient . startFlow ( testFlow . slug , input ) ;
@@ -154,7 +162,9 @@ describe('Flow Lifecycle Integration', () => {
154162 await grantMinimalPgflowPermissions ( sql ) ;
155163
156164 const supabaseClient = createTestSupabaseClient ( ) ;
157- const pgflowClient = new PgflowClient ( supabaseClient ) ;
165+ const pgflowClient = new PgflowClient ( supabaseClient , {
166+ realtimeStabilizationDelayMs : 1000 ,
167+ } ) ;
158168
159169 await expect (
160170 pgflowClient . startFlow ( 'nonexistent-flow' , { data : 'test' } )
@@ -178,7 +188,9 @@ describe('Flow Lifecycle Integration', () => {
178188
179189 const sqlClient = new PgflowSqlClient ( sql ) ;
180190 const supabaseClient = createTestSupabaseClient ( ) ;
181- const pgflowClient = new PgflowClient ( supabaseClient ) ;
191+ const pgflowClient = new PgflowClient ( supabaseClient , {
192+ realtimeStabilizationDelayMs : 1000 ,
193+ } ) ;
182194
183195 const run = await pgflowClient . startFlow ( testFlow . slug , {
184196 data : 'will-fail' ,
@@ -212,7 +224,9 @@ describe('Flow Lifecycle Integration', () => {
212224
213225 const sqlClient = new PgflowSqlClient ( sql ) ;
214226 const supabaseClient = createTestSupabaseClient ( ) ;
215- const pgflowClient = new PgflowClient ( supabaseClient ) ;
227+ const pgflowClient = new PgflowClient ( supabaseClient , {
228+ realtimeStabilizationDelayMs : 1000 ,
229+ } ) ;
216230
217231 const originalRun = await pgflowClient . startFlow ( testFlow . slug , {
218232 data : 'retrieve-test' ,
@@ -255,7 +269,9 @@ describe('Flow Lifecycle Integration', () => {
255269 await grantMinimalPgflowPermissions ( sql ) ;
256270
257271 const supabaseClient = createTestSupabaseClient ( ) ;
258- const pgflowClient = new PgflowClient ( supabaseClient ) ;
272+ const pgflowClient = new PgflowClient ( supabaseClient , {
273+ realtimeStabilizationDelayMs : 1000 ,
274+ } ) ;
259275
260276 const run = await pgflowClient . getRun (
261277 '00000000-0000-0000-0000-000000000000'
@@ -279,7 +295,9 @@ describe('Flow Lifecycle Integration', () => {
279295 await sql `SELECT pgflow.add_step(${ testFlow . slug } , 'cached_step')` ;
280296
281297 const supabaseClient = createTestSupabaseClient ( ) ;
282- const pgflowClient = new PgflowClient ( supabaseClient ) ;
298+ const pgflowClient = new PgflowClient ( supabaseClient , {
299+ realtimeStabilizationDelayMs : 1000 ,
300+ } ) ;
283301
284302 const run1 = await pgflowClient . startFlow ( testFlow . slug , {
285303 data : 'cache-test' ,
@@ -312,7 +330,9 @@ describe('Flow Lifecycle Integration', () => {
312330 await sql `SELECT pgflow.add_step(${ testFlow2 . slug } , 'step2')` ;
313331
314332 const supabaseClient = createTestSupabaseClient ( ) ;
315- const pgflowClient = new PgflowClient ( supabaseClient ) ;
333+ const pgflowClient = new PgflowClient ( supabaseClient , {
334+ realtimeStabilizationDelayMs : 1000 ,
335+ } ) ;
316336
317337 const run1 = await pgflowClient . startFlow ( testFlow1 . slug , {
318338 data : 'flow1' ,
@@ -354,7 +374,9 @@ describe('Flow Lifecycle Integration', () => {
354374 await sql `SELECT pgflow.add_step(${ testFlow . slug } , 'custom_step')` ;
355375
356376 const supabaseClient = createTestSupabaseClient ( ) ;
357- const pgflowClient = new PgflowClient ( supabaseClient ) ;
377+ const pgflowClient = new PgflowClient ( supabaseClient , {
378+ realtimeStabilizationDelayMs : 1000 ,
379+ } ) ;
358380
359381 const customRunId = `12345678-1234-1234-1234-${ Date . now ( )
360382 . toString ( )
@@ -384,7 +406,9 @@ describe('Flow Lifecycle Integration', () => {
384406 await sql `SELECT pgflow.add_step(${ testFlow . slug } , 'complex_step')` ;
385407
386408 const supabaseClient = createTestSupabaseClient ( ) ;
387- const pgflowClient = new PgflowClient ( supabaseClient ) ;
409+ const pgflowClient = new PgflowClient ( supabaseClient , {
410+ realtimeStabilizationDelayMs : 1000 ,
411+ } ) ;
388412
389413 const complexInput = {
390414 user : {
0 commit comments