diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ac9696f9a20..d8da3fc53b7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Docs: https://docs.openclaw.ai ### Fixes +- WhatsApp: update Baileys to `7.0.0-rc13` and keep the logger type patch aligned with the published package. - Infra/json: retry transient `File changed during read` races while loading JSON state so config and state reads recover instead of failing the turn. (#84285) - Providers/Ollama: resolve configured Ollama Cloud `OLLAMA_API_KEY` markers to the real discovery key so cloud provider entries keep authenticated model catalog access. (#85037) - Discord: keep persistent component registry fallback warnings actionable by forwarding structured error and cause metadata through the runtime logger. Fixes #84185. (#84190) Thanks @100menotu001. diff --git a/extensions/whatsapp/package.json b/extensions/whatsapp/package.json index dd3f83121811..a0f3166f7d31 100644 --- a/extensions/whatsapp/package.json +++ b/extensions/whatsapp/package.json @@ -9,7 +9,7 @@ "type": "module", "dependencies": { "audio-decode": "2.2.3", - "baileys": "7.0.0-rc12", + "baileys": "7.0.0-rc13", "https-proxy-agent": "9.0.0", "jimp": "1.6.1", "typebox": "1.1.38" diff --git a/extensions/whatsapp/src/login.coverage.test.ts b/extensions/whatsapp/src/login.coverage.test.ts index 77d6c4988806..acae9b35d142 100644 --- a/extensions/whatsapp/src/login.coverage.test.ts +++ b/extensions/whatsapp/src/login.coverage.test.ts @@ -123,9 +123,6 @@ describe("loginWeb coverage", () => { const runtime: RuntimeEnv = { log: vi.fn(), error: vi.fn(), exit: vi.fn() }; const pendingLogin = loginWeb(false, waitForWaConnectionMock as never, runtime); - await flushTasks(); - - expect(createWaSocketMock).toHaveBeenCalledTimes(2); await pendingLogin; expect(createWaSocketMock).toHaveBeenCalledTimes(2); diff --git a/extensions/whatsapp/src/setup-surface.test.ts b/extensions/whatsapp/src/setup-surface.test.ts index e78a56287ab2..967f64145554 100644 --- a/extensions/whatsapp/src/setup-surface.test.ts +++ b/extensions/whatsapp/src/setup-surface.test.ts @@ -29,6 +29,7 @@ const hoisted = vi.hoisted(() => ({ detectWhatsAppLinked: vi.fn<(cfg: OpenClawConfig, accountId: string) => Promise>( async () => false, ), + hasWebCredsSync: vi.fn(() => false), loginWeb: vi.fn(async () => {}), pathExists: vi.fn(async () => false), readWebAuthState: vi.fn<(authDir: string) => Promise<"linked" | "not-linked" | "unstable">>( @@ -53,6 +54,14 @@ vi.mock("./setup-finalize.js", async () => { }; }); +vi.mock("./creds-files.js", async () => { + const actual = await vi.importActual("./creds-files.js"); + return { + ...actual, + hasWebCredsSync: hoisted.hasWebCredsSync, + }; +}); + vi.mock("openclaw/plugin-sdk/setup", async () => { const actual = await vi.importActual( "openclaw/plugin-sdk/setup", @@ -142,6 +151,8 @@ describe("whatsapp setup wizard", () => { beforeEach(() => { hoisted.detectWhatsAppLinked.mockReset(); hoisted.detectWhatsAppLinked.mockResolvedValue(false); + hoisted.hasWebCredsSync.mockReset(); + hoisted.hasWebCredsSync.mockReturnValue(false); hoisted.loginWeb.mockReset(); hoisted.pathExists.mockReset(); hoisted.pathExists.mockResolvedValue(false); @@ -338,7 +349,7 @@ describe("whatsapp setup wizard", () => { }); it("skips relink note when already linked and relink is declined", async () => { - hoisted.pathExists.mockResolvedValue(true); + hoisted.hasWebCredsSync.mockReturnValue(true); const harness = createSeparatePhoneHarness({ selectValues: ["separate", "disabled"], }); diff --git a/patches/baileys@7.0.0-rc12.patch b/patches/baileys@7.0.0-rc13.patch similarity index 100% rename from patches/baileys@7.0.0-rc12.patch rename to patches/baileys@7.0.0-rc13.patch diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c884e3dc4ac0..6c391a9d9c48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,7 +35,7 @@ packageExtensionsChecksum: sha256-oc/FAHkBR844HBfph1RZWyRMHHBpIFya25tyv5SGf6s= patchedDependencies: '@agentclientprotocol/claude-agent-acp@0.36.1': f4f95d000b8694ca27dbbb969a7ebbfa9e45001e245a927201cb8bc43b6be641 - baileys@7.0.0-rc12: f2bd4db8403598ce9e4efafe859a27443a41c5ce25d97218de69169b4c03e18c + baileys@7.0.0-rc13: f2bd4db8403598ce9e4efafe859a27443a41c5ce25d97218de69169b4c03e18c importers: @@ -1648,8 +1648,8 @@ importers: specifier: 2.2.3 version: 2.2.3 baileys: - specifier: 7.0.0-rc12 - version: 7.0.0-rc12(patch_hash=f2bd4db8403598ce9e4efafe859a27443a41c5ce25d97218de69169b4c03e18c)(audio-decode@2.2.3)(jimp@1.6.1)(sharp@0.34.5) + specifier: 7.0.0-rc13 + version: 7.0.0-rc13(patch_hash=f2bd4db8403598ce9e4efafe859a27443a41c5ce25d97218de69169b4c03e18c)(audio-decode@2.2.3)(jimp@1.6.1)(sharp@0.34.5) https-proxy-agent: specifier: 9.0.0 version: 9.0.0 @@ -4609,8 +4609,8 @@ packages: bail@2.0.2: resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} - baileys@7.0.0-rc12: - resolution: {integrity: sha512-kttfToIBUKJb5hn57GspFbtlGaOp8wwhij7F8JRtduIL6vIODL5ze7XnsQKT73QwgFOGdJYXAT01x6rz9NNijg==} + baileys@7.0.0-rc13: + resolution: {integrity: sha512-v8k74K8B5R7WNYGa26MyJAYEu3Wc4BSuK01QaK8lr30lhE8Nga31nWNu8KN0NDDt+Fsvkq4SQFFI8Q13ghjKmA==} engines: {node: '>=20.0.0'} peerDependencies: audio-decode: ^2.1.3 @@ -10560,7 +10560,7 @@ snapshots: bail@2.0.2: {} - baileys@7.0.0-rc12(patch_hash=f2bd4db8403598ce9e4efafe859a27443a41c5ce25d97218de69169b4c03e18c)(audio-decode@2.2.3)(jimp@1.6.1)(sharp@0.34.5): + baileys@7.0.0-rc13(patch_hash=f2bd4db8403598ce9e4efafe859a27443a41c5ce25d97218de69169b4c03e18c)(audio-decode@2.2.3)(jimp@1.6.1)(sharp@0.34.5): dependencies: '@cacheable/node-cache': 1.7.6 '@hapi/boom': 9.1.4 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index af2a0233b905..30393b683ddd 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -14,7 +14,7 @@ minimumReleaseAgeExclude: - "@agentclientprotocol/sdk" - "axios" - "basic-ftp" - - "baileys@7.0.0-rc12" + - "baileys@7.0.0-rc13" - "hono" - "libsignal@6.0.0" - "openclaw" @@ -105,4 +105,4 @@ peerDependencyRules: patchedDependencies: "@agentclientprotocol/claude-agent-acp@0.36.1": "patches/@agentclientprotocol__claude-agent-acp@0.36.1.patch" - "baileys@7.0.0-rc12": "patches/baileys@7.0.0-rc12.patch" + "baileys@7.0.0-rc13": "patches/baileys@7.0.0-rc13.patch"