@@ -447,25 +447,25 @@ describe("provider update launch notification logic", () => {
447447 ) . toBe ( true ) ;
448448 } ) ;
449449
450- it ( "waits for a connection before offering cached provider updates " , ( ) => {
450+ it ( "keeps the notification key stable while connection readiness changes " , ( ) => {
451451 const cachedProvider = provider ( { driver : driver ( "codex" ) } ) ;
452452 const primary = environment ( {
453453 environmentId : "env-cached" ,
454454 isPrimary : true ,
455455 connectionState : "connecting" ,
456456 providers : [ cachedProvider ] ,
457457 } ) ;
458- const waiting = buildLocalEnvironmentUpdateGroups ( [ primary ] ) ;
459- expect ( waiting . groups [ 0 ] ?. candidates ) . toEqual ( [ ] ) ;
460- expect ( localEnvironmentUpdateNotificationKey ( waiting . groups ) ) . toBeNull ( ) ;
461-
462- const connected = buildLocalEnvironmentUpdateGroups ( [
463- { ... primary , connectionState : "ready" } ,
464- ] ) ;
465- expect ( connected . groups [ 0 ] ?. candidates ) . toEqual ( [ cachedProvider ] ) ;
466- expect ( localEnvironmentUpdateNotificationKey ( connected . groups ) ) . toBe (
467- "env-cached=codex:1.1.0" ,
468- ) ;
458+ for ( const connectionState of [
459+ "connecting" ,
460+ "ready" ,
461+ "disconnected" ,
462+ "error" ,
463+ "ready" ,
464+ ] as const ) {
465+ const { groups } = buildLocalEnvironmentUpdateGroups ( [ { ... primary , connectionState } ] ) ;
466+ expect ( groups [ 0 ] ?. isReady ) . toBe ( connectionState === "ready" ) ;
467+ expect ( localEnvironmentUpdateNotificationKey ( groups ) ) . toBe ( "env-cached=codex:1.1.0" ) ;
468+ }
469469 } ) ;
470470 } ) ;
471471
@@ -475,6 +475,7 @@ describe("provider update launch notification logic", () => {
475475 label : "WSL" ,
476476 isPrimary : false ,
477477 isSettling : false ,
478+ isReady : true ,
478479 candidates : [ updateCandidate ( { driver : driver ( "codex" ) , latestVersion : "1.1.0" } ) ] ,
479480 providers : [ ] ,
480481 } ;
0 commit comments