Skip to content

Commit ac5d219

Browse files
authored
fix(telegram): stop clearing registered webhook on channel restart (#94506)
Prepared head SHA: f721e14 Co-authored-by: xialonglee <li.xialong@xydigit.com>
1 parent ae41b00 commit ac5d219

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

extensions/telegram/src/webhook.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ describe("startTelegramWebhook", () => {
10431043
);
10441044
});
10451045

1046-
it("de-registers webhook when shutting down", async () => {
1046+
it("does not de-register webhook when shutting down", async () => {
10471047
deleteWebhookSpy.mockClear();
10481048
const abort = new AbortController();
10491049
await startTelegramWebhook({
@@ -1055,7 +1055,6 @@ describe("startTelegramWebhook", () => {
10551055
});
10561056

10571057
abort.abort();
1058-
expect(deleteWebhookSpy).toHaveBeenCalledTimes(1);
1059-
expect(deleteWebhookSpy).toHaveBeenCalledWith({ drop_pending_updates: false });
1058+
expect(deleteWebhookSpy).toHaveBeenCalledTimes(0);
10601059
});
10611060
});

extensions/telegram/src/webhook.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -415,13 +415,6 @@ export async function startTelegramWebhook(opts: {
415415
return;
416416
}
417417
shutDown = true;
418-
void withTelegramApiErrorLogging({
419-
operation: "deleteWebhook",
420-
runtime,
421-
fn: () => bot.api.deleteWebhook({ drop_pending_updates: false }),
422-
}).catch(() => {
423-
// withTelegramApiErrorLogging has already emitted the failure.
424-
});
425418
server.close();
426419
void bot.stop();
427420
status.noteWebhookStop();

0 commit comments

Comments
 (0)