fix(google-meet): wrap malformed browser status json · openclaw/openclaw@ae0cb0a
vincentkoc
·
2026-05-14
·
via Recent Commits to openclaw:main
File tree
extensions/google-meet/src/transports
| Original file line number | Diff line number | Diff line change |
|---|
@@ -56,6 +56,7 @@ Docs: https://docs.openclaw.ai
|
56 | 56 | - Microsoft Foundry: report malformed Azure CLI token JSON with owned auth errors instead of leaking raw parser failures. |
57 | 57 | - Gateway/model pricing: report malformed external pricing catalog JSON with source-owned errors instead of leaking raw parser failures. |
58 | 58 | - QA Lab: report malformed model-catalog subprocess JSON with an owned error and ignore invalid catalog rows. |
| 59 | +- Google Meet: report malformed browser-control status JSON with plugin-owned errors instead of leaking raw parser failures. |
59 | 60 | - Models config/auth: stop inferring provider env-var markers from broad `^[A-Z_][A-Z0-9_]*$` strings, and resolve config-backed provider `apiKey` values only through structured env SecretRefs (`secrets.providers[id]` / `secrets.defaults`), so unrelated env vars cannot accidentally become provider credentials. Thanks @sallyom. |
60 | 61 | - Media fetch: skip allocating and buffering the response body for bodyless media responses (HEAD probes and 204-style empty bodies), avoiding wasted heap on streams that carry no payload. Thanks @shakkernerd. |
61 | 62 | - CLI/onboarding: forward provider-specific auth flags (e.g. `--openai-api-key`) through the onboarding wizard so they reach provider auth methods via `ctx.opts`, letting `--openai-api-key "$OPENAI_API_KEY"` skip the redundant "use existing env var?" prompt in non-interactive harnesses. (#81669) Thanks @sjf. |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import { describe, expect, it } from "vitest"; |
| 2 | +import { __testing } from "./chrome.js"; |
| 3 | + |
| 4 | +describe("google meet chrome transport", () => { |
| 5 | +it("wraps malformed browser status JSON", () => { |
| 6 | +expect(() => |
| 7 | +__testing.parseMeetBrowserStatusForTest({ |
| 8 | +result: "{not json", |
| 9 | +}), |
| 10 | +).toThrow("Google Meet browser status JSON is malformed."); |
| 11 | +}); |
| 12 | +}); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -46,6 +46,7 @@ export const __testing = {
|
46 | 46 | chromeTransportDeps.callGatewayFromCli = deps?.callGatewayFromCli ?? callGatewayFromCli; |
47 | 47 | }, |
48 | 48 | meetStatusScriptForTest: meetStatusScript, |
| 49 | +parseMeetBrowserStatusForTest: parseMeetBrowserStatus, |
49 | 50 | }; |
50 | 51 | |
51 | 52 | function isGoogleMeetTalkBackMode(mode: GoogleMeetMode): boolean { |
@@ -232,7 +233,7 @@ function parseMeetBrowserStatus(result: unknown): GoogleMeetChromeHealth | undef
|
232 | 233 | if (typeof raw !== "string" || !raw.trim()) { |
233 | 234 | return undefined; |
234 | 235 | } |
235 | | -const parsed = JSON.parse(raw) as { |
| 236 | +let parsed: { |
236 | 237 | inCall?: boolean; |
237 | 238 | micMuted?: boolean; |
238 | 239 | lobbyWaiting?: boolean; |
@@ -254,6 +255,11 @@ function parseMeetBrowserStatus(result: unknown): GoogleMeetChromeHealth | undef
|
254 | 255 | title?: string; |
255 | 256 | notes?: string[]; |
256 | 257 | }; |
| 258 | +try { |
| 259 | +parsed = JSON.parse(raw) as typeof parsed; |
| 260 | +} catch { |
| 261 | +throw new Error("Google Meet browser status JSON is malformed."); |
| 262 | +} |
257 | 263 | return { |
258 | 264 | inCall: parsed.inCall, |
259 | 265 | micMuted: parsed.micMuted, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。