perf: lazy load bluebubbles catchup · openclaw/openclaw@2e2a134
steipete
·
2026-04-24
·
via Recent Commits to openclaw:main
File tree
extensions/bluebubbles/src
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime"; |
| 1 | +import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime"; |
2 | 2 | import type { NormalizedWebhookMessage } from "./monitor-normalize.js"; |
3 | 3 | import type { BlueBubblesCoreRuntime, WebhookTarget } from "./monitor-shared.js"; |
4 | 4 | import type { OpenClawConfig } from "./runtime-api.js"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,7 +8,7 @@ import {
|
8 | 8 | normalizeLowercaseStringOrEmpty, |
9 | 9 | normalizeOptionalLowercaseString, |
10 | 10 | normalizeOptionalString, |
11 | | -} from "openclaw/plugin-sdk/text-runtime"; |
| 11 | +} from "openclaw/plugin-sdk/string-coerce-runtime"; |
12 | 12 | import { |
13 | 13 | downloadBlueBubblesAttachment, |
14 | 14 | fetchBlueBubblesMessageAttachments, |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { IncomingMessage, ServerResponse } from "node:http"; |
2 | 2 | import { safeEqualSecret } from "openclaw/plugin-sdk/browser-security-runtime"; |
3 | 3 | import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; |
4 | | -import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime"; |
| 4 | +import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime"; |
5 | 5 | import { resolveBlueBubblesEffectiveAllowPrivateNetwork } from "./accounts.js"; |
6 | | -import { runBlueBubblesCatchup } from "./catchup.js"; |
7 | 6 | import { createBlueBubblesDebounceRegistry } from "./monitor-debounce.js"; |
8 | 7 | import { |
9 | 8 | asRecord, |
@@ -385,11 +384,13 @@ export async function monitorBlueBubblesProvider(
|
385 | 384 | // same processMessage path webhooks use, and #66230's inbound dedupe |
386 | 385 | // drops any GUID that was already handled, so this is safe even if a |
387 | 386 | // live webhook raced the startup replay. See #66721. |
388 | | -runBlueBubblesCatchup(target).catch((err) => { |
389 | | -runtime.error?.( |
390 | | -`[${account.accountId}] BlueBubbles catchup: unexpected failure: ${String(err)}`, |
391 | | -); |
392 | | -}); |
| 387 | +import("./catchup.js") |
| 388 | +.then(({ runBlueBubblesCatchup }) => runBlueBubblesCatchup(target)) |
| 389 | +.catch((err) => { |
| 390 | +runtime.error?.( |
| 391 | +`[${account.accountId}] BlueBubbles catchup: unexpected failure: ${String(err)}`, |
| 392 | +); |
| 393 | +}); |
393 | 394 | }); |
394 | 395 | } |
395 | 396 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。