惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗
博客园 - 聂微东
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Google DeepMind News
Google DeepMind News
Recent Announcements
Recent Announcements
IT之家
IT之家
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
爱范儿
爱范儿
Vercel News
Vercel News
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky
U
Unit 42
酷 壳 – CoolShell
酷 壳 – CoolShell
腾讯CDC
F
Fortinet All Blogs
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(telegram): acknowledge callbacks before sequentialize...
liuhao1024 · 2026-06-14 · via Recent Commits to openclaw:main

@@ -401,6 +401,81 @@ describe("createTelegramBot", () => {

401401

expect(harness.sequentializeKey).toBe(getTelegramSequentialKey);

402402

});

403403404+

it("answers callback queries before same-chat sequentialize delays handlers", async () => {

405+

installPerKeySequentializer();

406+

createTelegramBot({ token: "tok" });

407+

const callbackHandler = requireValue(

408+

getOnHandler("callback_query") as

409+

| ((ctx: Record<string, unknown>) => Promise<void>)

410+

| undefined,

411+

"callback_query handler",

412+

);

413+

let releaseBusyUpdate: (() => void) | undefined;

414+

const busyUpdateGate = new Promise<void>((resolve) => {

415+

releaseBusyUpdate = resolve;

416+

});

417+

const busyMessagePayload = {

418+

chat: { id: 1234, type: "private" },

419+

date: 1736380800,

420+

from: { id: 9, first_name: "Ada", username: "ada_bot" },

421+

message_id: 41,

422+

text: "busy",

423+

};

424+

const callbackQueryPayload = {

425+

id: "cbq-pre-sequentialize-1",

426+

data: "cmd:option_a",

427+

from: { id: 9, first_name: "Ada", username: "ada_bot" },

428+

message: {

429+

chat: { id: 1234, type: "private" },

430+

date: 1736380800,

431+

message_id: 42,

432+

},

433+

};

434+

const busyMessage = {

435+

update: { update_id: 401, message: busyMessagePayload },

436+

message: busyMessagePayload,

437+

me: { username: "openclaw_bot" },

438+

};

439+

const callbackCtx = {

440+

update: { update_id: 402, callback_query: callbackQueryPayload },

441+

callbackQuery: callbackQueryPayload,

442+

me: { username: "openclaw_bot" },

443+

getFile: async () => ({ download: async () => new Uint8Array() }),

444+

};

445+446+

const busyPromise = runTelegramMiddlewareChain({

447+

ctx: busyMessage,

448+

finalHandler: async () => {

449+

await busyUpdateGate;

450+

},

451+

});

452+

await flushTelegramTestMicrotasks();

453+454+

let callbackHandlerStarted = false;

455+

const callbackPromise = runTelegramMiddlewareChain({

456+

ctx: callbackCtx,

457+

finalHandler: async (ctx) => {

458+

callbackHandlerStarted = true;

459+

await callbackHandler(ctx);

460+

},

461+

});

462+

await flushTelegramTestMicrotasks();

463+464+

expect(callbackHandlerStarted).toBe(false);

465+

expect(answerCallbackQuerySpy).toHaveBeenCalledTimes(1);

466+

expect(answerCallbackQuerySpy).toHaveBeenCalledWith("cbq-pre-sequentialize-1");

467+468+

if (!releaseBusyUpdate) {

469+

throw new Error("Expected Telegram busy update release callback to be initialized");

470+

}

471+

releaseBusyUpdate();

472+

await busyPromise;

473+

await callbackPromise;

474+475+

expect(replySpy).toHaveBeenCalledTimes(1);

476+

expect(answerCallbackQuerySpy).toHaveBeenCalledTimes(1);

477+

});

478+404479

it("lets /status bypass a busy Telegram topic lane", async () => {

405480

installPerKeySequentializer();

406481

loadConfig.mockReturnValue({