@@ -891,7 +891,7 @@ describe("TelegramPollingSession", () => {
891891 } ) ;
892892 } ) ;
893893
894- it ( "keeps claims owned by another live process blocked " , async ( ) => {
894+ it ( "recovers restart-stale claims that reused the current process pid " , async ( ) => {
895895 await withTempSpool ( async ( tempDir ) => {
896896 const interruptedUpdate = topicUpdate ( 42 , 10 , "active topic 10 turn" ) ;
897897 await writeSpooledTestUpdates ( tempDir , [
@@ -916,7 +916,7 @@ describe("TelegramPollingSession", () => {
916916 receivedAt : interrupted . receivedAt ,
917917 update : interruptedUpdate ,
918918 claim : {
919- processId : "other-process " ,
919+ processId : "previous-gateway-instance " ,
920920 processPid : process . pid ,
921921 claimedAt : Date . now ( ) ,
922922 } ,
@@ -930,10 +930,10 @@ describe("TelegramPollingSession", () => {
930930 shouldRecover : ( claim ) => ! isTelegramSpooledUpdateClaimOwnedByOtherLiveProcess ( claim ) ,
931931 } ) ;
932932
933- expect ( recovered ) . toBe ( 0 ) ;
934- expect ( await pendingUpdateIds ( tempDir ) ) . toEqual ( [ 43 ] ) ;
933+ expect ( recovered ) . toBe ( 1 ) ;
934+ expect ( await pendingUpdateIds ( tempDir ) ) . toEqual ( [ 42 , 43 ] ) ;
935935 expect ( ( await fs . readdir ( tempDir ) ) . toSorted ( ) ) . toEqual ( [
936- "0000000000000042.json.processing " ,
936+ "0000000000000042.json" ,
937937 "0000000000000043.json" ,
938938 ] ) ;
939939 } ) ;
0 commit comments