fix(telegram): preserve live spool claim owners · openclaw/openclaw@4957286
vincentkoc
·
2026-06-16
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -258,7 +258,7 @@ describe("Telegram ingress spool", () => {
|
258 | 258 | }); |
259 | 259 | }); |
260 | 260 | |
261 | | -it("does not treat claims with the current process pid as other live process claims", () => { |
| 261 | +it("does not treat stale claims with reused pids as live-owned", () => { |
262 | 262 | const now = Date.now(); |
263 | 263 | expect( |
264 | 264 | isTelegramSpooledUpdateClaimOwnedByOtherLiveProcess({ |
@@ -270,9 +270,27 @@ describe("Telegram ingress spool", () => {
|
270 | 270 | claim: { |
271 | 271 | processId: "other-process", |
272 | 272 | processPid: process.pid, |
273 | | -claimedAt: now, |
| 273 | +claimedAt: now - TELEGRAM_SPOOLED_UPDATE_PROCESSING_STALE_MS - 1, |
274 | 274 | }, |
275 | 275 | }), |
276 | 276 | ).toBe(false); |
277 | 277 | }); |
| 278 | + |
| 279 | +it("treats fresh claims with reused pids and different owner ids as live-owned", () => { |
| 280 | +const now = Date.now(); |
| 281 | +expect( |
| 282 | +isTelegramSpooledUpdateClaimOwnedByOtherLiveProcess({ |
| 283 | +updateId: 50, |
| 284 | +path: path.join(os.tmpdir(), "50.json.processing"), |
| 285 | +pendingPath: path.join(os.tmpdir(), "50.json"), |
| 286 | +update: { update_id: 50 }, |
| 287 | +receivedAt: now, |
| 288 | +claim: { |
| 289 | +processId: "other-process", |
| 290 | +processPid: process.pid, |
| 291 | +claimedAt: now, |
| 292 | +}, |
| 293 | +}), |
| 294 | +).toBe(true); |
| 295 | +}); |
278 | 296 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。