Skip to content

fix(updater): harden getUpdateServerResponse with timeouts, retry, and HTTP status validation#738

Merged
skjnldsv merged 3 commits intomasterfrom
jtr/fix-update-server-response-robustness
Apr 8, 2026
Merged

fix(updater): harden getUpdateServerResponse with timeouts, retry, and HTTP status validation#738
skjnldsv merged 3 commits intomasterfrom
jtr/fix-update-server-response-robustness

Conversation

@joshtrichards
Copy link
Copy Markdown
Member

Over the weekend apparently there was an Updater Server event causing unexpected responses. This attempts to make the initial checks a bit more robust and informative (rather than just indicating "No update available").

Changes:

  • Validate HTTP status code
  • Clear libxml error state in a finally block to prevent leaking into subsequent parsing
  • Add CURLOPT_CONNECTTIMEOUT (10s) and CURLOPT_TIMEOUT (30s) to prevent indefinite hangs
  • Retry once with 1s backoff on transient failures
  • Tests for new scenarios:
    • Server returns a non-200 status code
    • Server returns 200 but body is not parseable XML
    • Connection refused / timeout

P.S. We should consider maybe adjusting the updater_server API contract to use 204, but it's not a huge deal at the moment.

…d HTTP status validation

- Validate HTTP status code
- Clear libxml error state in a finally block to prevent leaking into subsequent parsing
- Add CURLOPT_CONNECTTIMEOUT (10s) and CURLOPT_TIMEOUT (30s) to prevent indefinite hangs
- Retry once with 1s backoff on transient failures

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
…onse

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added enhancement 3. to review robustness 💪 Enhancements (and bugs) related to robustness labels Apr 7, 2026
@joshtrichards joshtrichards added this to the Nextcloud 34 milestone Apr 7, 2026
@skjnldsv skjnldsv merged commit 40933c5 into master Apr 8, 2026
18 of 21 checks passed
@skjnldsv skjnldsv deleted the jtr/fix-update-server-response-robustness branch April 8, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review enhancement robustness 💪 Enhancements (and bugs) related to robustness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants