@@ -26,21 +26,15 @@ beforeAll(async () => {
2626 publicKeyB64 = bytesToBase64 ( await getPublicKeyAsync ( privateKey ) ) ;
2727} ) ;
2828
29- function config ( options : { kill ?: boolean ; min ?: string ; target ?: string } = { } ) {
29+ function config ( options : { maintenance ?: boolean ; min ?: string ; target ?: string } = { } ) {
3030 return {
3131 v : 1 ,
3232 app : 'app_test' ,
3333 env : 'production' ,
3434 published_at : '2026-01-01T00:00:00Z' ,
3535 key_id : KEY_ID ,
36- kill : {
37- active : options . kill ?? false ,
38- platforms : [ ] ,
39- version_ranges : [ ] ,
40- message_key : 'kill_default' ,
41- } ,
4236 maintenance : {
43- active : false ,
37+ active : options . maintenance ?? false ,
4438 starts_at : null ,
4539 ends_at : null ,
4640 message_key : 'maint_default' ,
@@ -61,7 +55,8 @@ function config(options: { kill?: boolean; min?: string; target?: string } = {})
6155 force_body : 'Reload to continue.' ,
6256 soft_title : 'Update available' ,
6357 soft_body : 'A new version is ready.' ,
64- kill_default : 'App unavailable' ,
58+ maint_title : 'Back shortly' ,
59+ maint_default : 'Down for maintenance.' ,
6560 } ,
6661 } ,
6762 } ;
@@ -118,7 +113,7 @@ describe('the client', () => {
118113 } ) ;
119114
120115 it ( 'refuses a forged signature and lets the app run' , async ( ) => {
121- const { impl } = server ( config ( { kill : true } ) , { corrupt : true } ) ;
116+ const { impl } = server ( config ( { maintenance : true } ) , { corrupt : true } ) ;
122117 const gate = await boot ( impl ) ;
123118
124119 expect ( ( await gate . check ( ) ) . type ) . toBe ( 'none' ) ;
@@ -133,23 +128,23 @@ describe('the client', () => {
133128
134129 it ( 'falls back to cache when the network fails' , async ( ) => {
135130 const storage = new MemoryStorage ( ) ;
136- const good = server ( config ( { kill : true } ) ) ;
131+ const good = server ( config ( { maintenance : true } ) ) ;
137132 const first = await boot ( good . impl , { storage } ) ;
138- expect ( ( await first . check ( ) ) . type ) . toBe ( 'kill ' ) ;
133+ expect ( ( await first . check ( ) ) . type ) . toBe ( 'maintenance ' ) ;
139134
140135 const broken = server ( config ( ) , { status : 500 } ) ;
141136 const second = await boot ( broken . impl , { storage } ) ;
142137
143- expect ( ( await second . check ( ) ) . type ) . toBe ( 'kill ' ) ;
138+ expect ( ( await second . check ( ) ) . type ) . toBe ( 'maintenance ' ) ;
144139 expect ( second . source ) . toBe ( 'cached' ) ;
145140 } ) ;
146141
147142 it ( 'refuses a tampered cache' , async ( ) => {
148143 const storage = new MemoryStorage ( ) ;
149- const good = server ( config ( { kill : true } ) ) ;
144+ const good = server ( config ( { maintenance : true } ) ) ;
150145 await boot ( good . impl , { storage } ) ;
151146
152- // Someone opens devtools and edits localStorage to lift the kill .
147+ // Someone opens devtools and edits localStorage to lift the wall .
153148 const raw = JSON . parse ( storage . read ( `ripstop.config.${ KEY } ` ) ! ) as { body : string } ;
154149 raw . body = JSON . stringify ( config ( ) ) ;
155150 storage . write ( `ripstop.config.${ KEY } ` , JSON . stringify ( raw ) ) ;
0 commit comments