@@ -410,9 +410,9 @@ describe('WireService corruption repair', () => {
410410 } ;
411411 const telemetry : ITelemetryService = {
412412 ...noopTelemetryService ,
413- track2 : ( ( name : string , payload : unknown ) => {
413+ track2 : ( name , payload ) => {
414414 capture . events . push ( { name, payload } ) ;
415- } ) as ITelemetryService [ 'track2' ] ,
415+ } ,
416416 } ;
417417 const localIx = disposables . add ( new TestInstantiationService ( ) ) ;
418418 return registerTestAgentWire ( localIx , testWireScope ( SCOPE , key ) , {
@@ -541,6 +541,27 @@ describe('WireService corruption repair', () => {
541541 ] ) ;
542542 } ) ;
543543
544+ it ( 'counts dropped lines from the damaged line when the repair inserts metadata' , async ( ) => {
545+ const capture : RepairCapture = { warnings : [ ] , events : [ ] } ;
546+ const svc = wireWithCapture ( KEY , capture ) ;
547+ const raw = `${ JSON . stringify ( { type : 'wire.test.legacy' , time : 9 } ) } \nGARBAGE\n` ;
548+ await seedCorrupt ( raw ) ;
549+
550+ await collect ( svc . readJournal ( ) ) ;
551+
552+ expect ( capture . events ) . toEqual ( [
553+ {
554+ name : 'wire_repair' ,
555+ payload : {
556+ kind : 'corrupted' ,
557+ outcome : 'repaired' ,
558+ dropped_count : 1 ,
559+ backup_created : true ,
560+ } ,
561+ } ,
562+ ] ) ;
563+ } ) ;
564+
544565 it ( 'reports a torn tail as truncation through the wire_repair event' , async ( ) => {
545566 const capture : RepairCapture = { warnings : [ ] , events : [ ] } ;
546567 const svc = wireWithCapture ( KEY , capture ) ;
0 commit comments