Skip to content

fix: register BlueBubbles webhook route before server-info fetch#657

Open
BingqingLyu wants to merge 4 commits intomainfrom
fork-pr-45664-fix-issue-45620-v2
Open

fix: register BlueBubbles webhook route before server-info fetch#657
BingqingLyu wants to merge 4 commits intomainfrom
fork-pr-45664-fix-issue-45620-v2

Conversation

@BingqingLyu
Copy link
Copy Markdown
Owner

@BingqingLyu BingqingLyu commented Apr 27, 2026

Summary

monitorBlueBubblesProvider was calling fetchBlueBubblesServerInfo (up to 5 s timeout) before registering the webhook HTTP route via registerBlueBubblesWebhookTarget. This created a gap on every startup and after every crash-loop restart where the plugin HTTP registry had no entry for /bluebubbles-webhook, so the request fell through all gateway stages and returned 404 Not Found.

Changes

  • extensions/bluebubbles/src/monitor.ts — Move registerBlueBubblesWebhookTarget to the top of monitorBlueBubblesProvider, before the async fetchBlueBubblesServerInfo call. The webhook route is now reachable immediately when the provider starts or restarts; server info is still fetched and cached for macOS version detection.

  • src/gateway/server-channels.ts — Fix off-by-one in crash-loop restart accounting: when the loop hit MAX_RESTART_ATTEMPTS + 1 it was setting reconnectAttempts = MAX + 1 (e.g. 11) instead of MAX (10). Now caps the reported value at MAX_RESTART_ATTEMPTS.

Testing

  • extensions/bluebubbles/src/monitor.test.ts — 60 tests pass (no regressions in webhook parsing, auth, and routing)
  • extensions/bluebubbles/src/monitor.webhook-route.test.ts — 1 test passes
  • extensions/bluebubbles/src/monitor.webhook-auth.test.ts — 16 tests pass
  • src/gateway/server-channels.test.ts — all 4 tests pass (including the previously-failing "caps crash-loop restarts after max attempts")
  • src/gateway/server.plugin-http-auth.test.ts — 21 tests pass
  • src/gateway/control-ui-routing.test.ts — 16 tests pass

Fixes openclaw#45620

Dresing and others added 4 commits March 8, 2026 12:37
…cation

Slack sends url_verification challenges WITHOUT a signature (by design).
The HTTPReceiver was rejecting these requests because it verifies
signatures on ALL requests, but url_verification is never signed.

This fix intercepts incoming HTTP requests BEFORE they reach the
receiver's signature verification:
1. Read the request body first
2. Check if it's a url_verification request
3. If yes, respond directly with the challenge (no signature needed)
4. If no, replay the body to the receiver using a PassThrough stream

This allows HTTP webhook mode to complete the Slack handshake and
activate properly, fixing the regression in v2026.3.2.

Closes openclaw#39432
Handle file lock errors gracefully when .openclaw directory is synced
via cloud storage services (OneDrive, Dropbox, Google Drive, etc.).
Retry up to 3 times with exponential backoff before failing.

Fixes openclaw#39446
fix: add retry logic for file lock errors (EBUSY, EACCES, EPERM)
Previously, monitorBlueBubblesProvider called fetchBlueBubblesServerInfo
(up to 5 s timeout) *before* registering the webhook HTTP route.  This
created a window on every startup and after every crash-loop restart
where POST /bluebubbles-webhook returned 404: the plugin HTTP registry
had no matching entry yet so the request fell all the way through the
gateway's stage pipeline.

Fix: move registerBlueBubblesWebhookTarget to the top of the function,
before the async server-info fetch, so the route is reachable as soon
as the provider (re)starts.

Also fix an off-by-one in server-channels restart accounting: when the
crash-loop hit MAX_RESTART_ATTEMPTS + 1 it was reporting
reconnectAttempts = MAX + 1 instead of MAX, causing the snapshot to
show one extra attempt than the configured cap.

Fixes openclaw#45620
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: BlueBubbles webhook appears to be listening, but POST /bluebubbles-webhook returns 404 in OpenClaw 2026.3.12

2 participants