Skip to content

fix(nextcloud-talk): add timeouts to Talk send requests - #102025

Merged
steipete merged 2 commits into
openclaw:mainfrom
Alix-007:alix/nextcloud-talk-fetch-timeout
Jul 9, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
Alix-007:alix/nextcloud-talk-fetch-timeout

Conversation

@Alix-007

@Alix-007 Alix-007 commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users sending Nextcloud Talk messages or reactions could have the send workflow wait indefinitely when the Talk server accepts the HTTP connection but never responds.

Why This Change Was Made

Nextcloud Talk's preflight path already passes a request timeout into fetchWithSsrFGuard; this change applies the same bounded request behavior to message and reaction sends while preserving the existing SSRF policy, headers, and response handling.

User Impact

Operators get a bounded failure instead of a stuck outbound send when a self-hosted or remote Talk endpoint hangs after accepting the connection.

Evidence

  • TMPDIR=/media/vdc/0668001470/tmp/openclaw-task-tmp node scripts/run-vitest.mjs extensions/nextcloud-talk/src/send.fetch-timeout.test.ts - passed; Test Files 1 passed (1), Tests 1 passed (1).
  • Maintainer exact-head proof: sanitized AWS Crabbox cbx_737788970066, run run_d95e3af3e15a, passed the focused test at a5ce0e7331aa8c6ce25464476fd98d343ded5d8d.
  • TMPDIR=/media/vdc/0668001470/tmp/openclaw-task-tmp node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/nextcloud-talk/src/send.ts extensions/nextcloud-talk/src/send.fetch-timeout.test.ts - passed; exit 0.
  • git diff --check - passed; exit 0.
  • Mutation check: temporarily removing the two timeoutMs guard parameters made the focused Vitest fail with 2 failed and expected 'pending' to be 'rejected' for both message and reaction paths; restoring the patch returned the test to green.

Real behavior proof

Behavior addressed: Nextcloud Talk message and reaction POSTs now have a deadline when the remote server accepts the request but never sends a response.

Real environment tested: local Linux Node source checkout; real node:http loopback server that accepts the connection and never responds, driving the real exported sendMessageNextcloudTalk and sendReactionNextcloudTalk functions.

Exact steps or command run after this patch: TMPDIR=/media/vdc/0668001470/tmp/openclaw-task-tmp node scripts/run-vitest.mjs extensions/nextcloud-talk/src/send.fetch-timeout.test.ts

Evidence after fix: the focused test asserts the real loopback server receives the outbound message and reaction POSTs; without the timeout wiring the calls remain pending past the race window, and with the patch they reject with an abort/timeout-class error.

Observed result after fix: Test Files 1 passed (1) and Tests 1 passed (1).

What was not tested: a live Nextcloud Talk endpoint; the hang is reproduced with a real local HTTP server, not the real third-party service.

@openclaw-barnacle openclaw-barnacle Bot added channel: nextcloud-talk Channel integration: nextcloud-talk size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 8, 2026
@clawsweeper

clawsweeper Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 2:43 AM ET / 06:43 UTC.

Summary
Adds a 30s timeout to Nextcloud Talk message and reaction send requests and adds loopback hanging-server regression tests for both paths.

PR surface: Source +4, Tests +185. Total +189 across 2 files.

Reproducibility: yes. Current main has no timeoutMs on the two send/reaction fetchWithSsrFGuard calls, and the PR's loopback test demonstrates the hang class with a real local HTTP server that accepts the request and never responds.

Review metrics: 1 noteworthy metric.

  • Runtime default: 1 added: 30s outbound send/reaction deadline. This changes upgrade behavior from unbounded waiting to bounded failure for Nextcloud Talk outbound POSTs.

Root-cause cluster
Relationship: canonical
Canonical: #102025
Summary: This PR is the current open canonical candidate for the Nextcloud Talk outbound send/reaction timeout gap; older same-surface attempts are closed unmerged, and related timeout items are adjacent campaign work rather than replacements.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Maintainer should explicitly accept the 30s default or request a documented/configurable timeout policy before merge.

Risk before merge

  • [P1] Existing self-hosted Nextcloud Talk servers that legitimately take longer than 30 seconds to complete message or reaction POSTs will now fail instead of continuing to wait, so maintainers should explicitly accept that upgrade behavior.
  • [P2] The proof validates timeout wiring with a real local HTTP loopback server rather than a live Nextcloud Talk instance, so service-specific latency behavior is not directly demonstrated.

Maintainer options:

  1. Accept bounded sends (recommended)
    Merge as-is if maintainers agree that a 30s bounded failure is safer than an indefinite Nextcloud Talk outbound hang.
  2. Make the timeout policy explicit
    Request a narrow update that documents or configures the Nextcloud Talk outbound timeout before merge.

Next step before merge

  • No automated repair is needed; the remaining action is maintainer acceptance of the 30s default timeout versus a plugin timeout policy.

Maintainer decision needed

  • Question: Should Nextcloud Talk outbound message and reaction sends use a hard 30s default timeout, or should this PR add a documented/configurable plugin timeout policy before merge?
  • Rationale: The code fix is mechanically narrow and uses the existing SSRF guard, but the default changes existing slow-server behavior from unbounded wait to bounded failure.
  • Likely owner: Vincent Koc — Vincent has the strongest current-main and policy-boundary history for this timeout-default tradeoff.
  • Options:
    • Accept 30s bounded failure (recommended): Merge as-is and treat hung or very slow outbound Nextcloud Talk sends as failures after 30 seconds.
    • Require explicit timeout policy: Ask for a small follow-up in this PR to document or configure the Nextcloud Talk outbound send timeout before merge.

Security
Cleared: No concrete security or supply-chain regression was found; the patch preserves the existing SSRF guard path and adds only a bounded deadline plus tests.

Review details

Best possible solution:

Land the shared fetchWithSsrFGuard timeout wiring if maintainers accept 30 seconds as the plugin default; otherwise make the Nextcloud Talk outbound timeout policy explicit before merge.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main has no timeoutMs on the two send/reaction fetchWithSsrFGuard calls, and the PR's loopback test demonstrates the hang class with a real local HTTP server that accepts the request and never responds.

Is this the best way to solve the issue?

Yes, with a maintainer-default caveat. Passing timeoutMs into the existing shared SSRF guard is the narrowest maintainable fix; adding direct AbortSignal wiring or a broad new config knob would be a worse layer unless maintainers reject the fixed 30s policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 20f355f2368c.

Label changes

Label justifications:

  • P2: This is a focused channel bug fix for a limited-blast-radius outbound send/reaction hang on non-responsive Nextcloud Talk servers.
  • merge-risk: 🚨 compatibility: The PR intentionally changes existing Nextcloud Talk outbound behavior from unbounded waiting to failure after 30 seconds, which can affect unusually slow self-hosted servers.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal proof from a real local node:http loopback server that accepts the request and hangs while exercising the exported send functions; that is sufficient for the timeout behavior, though it is not live Nextcloud service proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal proof from a real local node:http loopback server that accepts the request and hangs while exercising the exported send functions; that is sufficient for the timeout behavior, though it is not live Nextcloud service proof.
Evidence reviewed

PR surface:

Source +4, Tests +185. Total +189 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 0 +4
Tests 1 185 0 +185
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 189 0 +189

What I checked:

  • Current main send path is still unbounded: On current main, both Nextcloud Talk outbound POSTs call fetchWithSsrFGuard with SSRF policy and audit context but without timeoutMs, so current main has not already implemented this PR's central behavior. (extensions/nextcloud-talk/src/send.ts:180, 20f355f2368c)
  • PR wires the shared guard timeout on both send surfaces: The PR commit adds NEXTCLOUD_TALK_SEND_TIMEOUT_MS = 30_000, adds a private timeoutMs test override, and passes opts.timeoutMs ?? NEXTCLOUD_TALK_SEND_TIMEOUT_MS into the existing message and reaction fetchWithSsrFGuard calls. (extensions/nextcloud-talk/src/send.ts:196, bc19302ced22)
  • Regression proof exercises the exported send functions: The added test starts a real loopback HTTP server that accepts requests and never responds, then drives sendMessageNextcloudTalk and sendReactionNextcloudTalk with a short timeout and asserts timeout-class rejection after the request is received. (extensions/nextcloud-talk/src/send.fetch-timeout.test.ts:134, bc19302ced22)
  • Shared fetch guard supports this timeout contract: fetchWithSsrFGuard builds a timeout abort signal from params.timeoutMs and passes the signal into the actual fetch init, so the PR uses the existing guarded network seam rather than introducing a parallel request path. (src/infra/net/fetch-guard.ts:451, 20f355f2368c)
  • Timeout helper produces a timeout-class abort: buildTimeoutAbortSignal normalizes timeoutMs, schedules a timer, and aborts with an Error named TimeoutError, matching the PR test's expected abort/timeout rejection class. (src/utils/fetch-timeout.ts:108, 20f355f2368c)
  • Runtime callers route visible sends and reactions through these helpers: The channel message adapter sends text/media through sendMessageNextcloudTalk, and the message action handler sends reactions through sendReactionNextcloudTalk, so the timeout applies to the intended outbound workflow. (extensions/nextcloud-talk/src/message-adapter.ts:16, 20f355f2368c)

Likely related people:

  • Vincent Koc: Current-main blame attributes the present send helper snapshot to Vincent Koc, and history shows related private-network alias migration that affects the SSRF policy boundary used by this PR. (role: recent area contributor; confidence: medium; commits: c0d99ed26ea2, c863ee1b86c1; files: extensions/nextcloud-talk/src/send.ts)
  • Alix-007: Alix-007 has prior merged Nextcloud Talk send hardening in the same helper, specifically the bounded external send/reaction response-read work, so they are relevant beyond being this PR's author. (role: recent area contributor; confidence: high; commits: d577cb2fe9ea; files: extensions/nextcloud-talk/src/send.ts, extensions/nextcloud-talk/src/send.cfg-threading.test.ts)
  • Jacob Tomlinson: Jacob Tomlinson authored the merged extensions routing change that moved Nextcloud Talk send calls onto fetchWithSsrFGuard, the exact seam this PR extends with timeoutMs. (role: introduced relevant guarded fetch path; confidence: high; commits: f92c92515bd4; files: extensions/nextcloud-talk/src/send.ts)
  • Peter Steinberger: History around the same file includes send-context and runtime seam refactors by Peter Steinberger, making him a reasonable routing candidate for owner-boundary review if Vincent is unavailable. (role: adjacent send-helper refactor contributor; confidence: medium; commits: a4525b721edd, 6d05607cd9f8, 185668f5c54a; files: extensions/nextcloud-talk/src/send.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-08T04:51:01.686Z sha bc19302ced227efe9a726512b267a3db7204f509 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 8, 2026
@steipete steipete self-assigned this Jul 9, 2026
@steipete
steipete force-pushed the alix/nextcloud-talk-fetch-timeout branch from bc72e12 to a5ce0e7 Compare July 9, 2026 10:40
@steipete

steipete commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Land-ready maintainer review complete.

  • Best-fix verdict: the two Nextcloud Talk send owners now pass a 30-second default deadline to the existing SSRF-guarded fetch path; message and reaction behavior, signing, response bounds, and dispatcher release remain unchanged.
  • Test improvement: replaced the 185-line private TCP/socket harness with the shared openclaw/plugin-sdk/test-env server helper and one focused production-path loopback assertion.
  • Exact-head proof: sanitized AWS Crabbox cbx_737788970066, run run_d95e3af3e15a, passed pnpm test extensions/nextcloud-talk/src/send.fetch-timeout.test.ts at a5ce0e7331aa8c6ce25464476fd98d343ded5d8d (1 file, 1 test).
  • Final autoreview: clean. Hosted exact-head CI: green via scripts/pr prepare-run.
  • Remaining gap: no live Nextcloud Talk tenant call; the real HTTP hang and abort path are covered by loopback proof.

@steipete
steipete merged commit bebf0b9 into openclaw:main Jul 9, 2026
96 checks passed
@steipete

steipete commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 10, 2026
)

* fix(nextcloud-talk): add timeouts to Talk send requests

* test(nextcloud-talk): simplify send timeout proof

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: nextcloud-talk Channel integration: nextcloud-talk merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants