@@ -593,7 +593,7 @@ describe("createHotPollCoordinator", () => {
593593 } ) ;
594594 } ) ;
595595
596- it ( "applies exponential backoff on errors" , async ( ) => {
596+ it ( "applies exponential backoff on errors and surfaces via pushError " , async ( ) => {
597597 const onHotData = vi . fn ( ) ;
598598 // fetchHotPRStatus uses Promise.allSettled, so graphql errors set hadErrors=true
599599 // without throwing — consecutiveFailures increments via the hadErrors path
@@ -606,13 +606,18 @@ describe("createHotPollCoordinator", () => {
606606 pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , nodeId : "PR_a" } ) ] ,
607607 } ) ;
608608
609+ const { pushError } = await import ( "../../src/app/lib/errors" ) ;
610+ ( pushError as ReturnType < typeof vi . fn > ) . mockClear ( ) ;
611+
609612 await createRoot ( async ( dispose ) => {
610613 createHotPollCoordinator ( ( ) => 10 , onHotData ) ;
611614
612615 // First cycle at 10s — hadErrors=true, consecutiveFailures=1
613616 await vi . advanceTimersByTimeAsync ( 10_000 ) ;
614617 const callsAfterFirst = graphqlFn . mock . calls . length ;
615618 expect ( callsAfterFirst ) . toBe ( 1 ) ;
619+ // hadErrors surfaces error to user
620+ expect ( pushError ) . toHaveBeenCalledWith ( "hot-poll" , expect . any ( String ) , true ) ;
616621
617622 // Next cycle should be at 10s * 2^1 = 20s from first cycle
618623 // Advance 10s — should NOT have fired another fetch yet
0 commit comments