@@ -274,7 +274,7 @@ describe("DesktopUpdates", () => {
274274 } ) . pipe ( Effect . provide ( Layer . merge ( TestClock . layer ( ) , harness . layer ) ) ) ;
275275 } ) ;
276276
277- it . effect ( "updates and broadcasts state from updater events " , ( ) => {
277+ it . effect ( "downloads and broadcasts an available update immediately " , ( ) => {
278278 const harness = makeHarness ( ) ;
279279
280280 return Effect . scoped (
@@ -286,10 +286,10 @@ describe("DesktopUpdates", () => {
286286 yield * flushCallbacks ;
287287
288288 const state = yield * updates . getState ;
289- assert . equal ( state . status , "available " ) ;
289+ assert . equal ( state . status , "downloading " ) ;
290290 assert . equal ( state . availableVersion , "1.2.4" ) ;
291291 assert . isNotNull ( state . checkedAt ) ;
292- assert . equal ( harness . sentStates . at ( - 1 ) ?. status , "available " ) ;
292+ assert . equal ( harness . sentStates . at ( - 1 ) ?. status , "downloading " ) ;
293293 } ) ,
294294 ) . pipe ( Effect . provide ( Layer . merge ( TestClock . layer ( ) , harness . layer ) ) ) ;
295295 } ) ;
@@ -321,7 +321,7 @@ describe("DesktopUpdates", () => {
321321 yield * flushCallbacks ;
322322
323323 const state = yield * updates . getState ;
324- assert . equal ( state . status , "available " ) ;
324+ assert . equal ( state . status , "downloading " ) ;
325325 assert . deepEqual ( state . releaseNotes , [
326326 {
327327 version : "1.2.4-nightly.20260709.766" ,
@@ -407,7 +407,7 @@ describe("DesktopUpdates", () => {
407407 ) ;
408408 } ) ;
409409
410- it . effect ( "recovers download state after an unexpected setup failure" , ( ) => {
410+ it . effect ( "leaves an automatic download available to retry after setup failure" , ( ) => {
411411 let disableDifferentialCalls = 0 ;
412412 const harness = makeHarness ( {
413413 setDisableDifferentialDownload : Effect . suspend ( ( ) => {
@@ -425,10 +425,6 @@ describe("DesktopUpdates", () => {
425425 harness . emit ( "update-available" , { version : "1.2.4" } ) ;
426426 yield * flushCallbacks ;
427427
428- const result = yield * updates . download ;
429- assert . isTrue ( result . accepted ) ;
430- assert . isFalse ( result . completed ) ;
431-
432428 const failedState = yield * updates . getState ;
433429 assert . equal ( failedState . status , "available" ) ;
434430 assert . equal ( failedState . errorContext , "download" ) ;
@@ -451,6 +447,9 @@ describe("DesktopUpdates", () => {
451447 return Effect . void ;
452448 }
453449 if ( disableDifferentialCalls === 2 ) {
450+ return Effect . die ( new Error ( "automatic download setup failed" ) ) ;
451+ }
452+ if ( disableDifferentialCalls === 3 ) {
454453 return Deferred . succeed ( actionStarted , undefined ) . pipe ( Effect . andThen ( Effect . never ) ) ;
455454 }
456455 return Effect . void ;
@@ -470,7 +469,10 @@ describe("DesktopUpdates", () => {
470469
471470 const interruptedState = yield * updates . getState ;
472471 assert . equal ( interruptedState . status , "available" ) ;
473- assert . isNull ( interruptedState . message ) ;
472+ assert . equal (
473+ interruptedState . message ,
474+ "Desktop update download action failed unexpectedly." ,
475+ ) ;
474476
475477 const retry = yield * updates . download ;
476478 assert . isTrue ( retry . accepted ) ;
0 commit comments