Skip to content

Propagate response body read errors - #8

Merged
evanpurkhiser merged 1 commit into
evanpurkhiser:mainfrom
joaodrp:fix/propagate-body-read-error
Sep 2, 2026
Merged

Propagate response body read errors#8
evanpurkhiser merged 1 commit into
evanpurkhiser:mainfrom
joaodrp:fix/propagate-body-read-error

Conversation

@joaodrp

@joaodrp joaodrp commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Drop the connection mid-page during a sync and things3 today still exits 0,
printing whatever the last good sync left behind. Nothing says the sync stopped
early. Now it fails with failed reading body from <url> (HTTP 200).

resp.text().unwrap_or_default() turns the read error into an empty string, and
request hands that back as Ok(json!({})). sync_append_log sees a page with
no items and calls it the end of history.

Two other spots discard a Result like this, but neither changes what a command
returns. Happy to warn and carry on instead of failing, if you'd rather.

`resp.text().unwrap_or_default()` turns a failed body read into an empty
string, which `request` then returns as `Ok(json!({}))`. A connection
dropped mid-body therefore looks like a successful empty response: the
caller sees a page with no items, `sync_append_log` stops, and the CLI
renders stale data without surfacing an error.

The status stays in the message, since an error status with an unreadable
body was the one case the old code still reported.
@evanpurkhiser
evanpurkhiser merged commit 7ba679b into evanpurkhiser:main Sep 2, 2026
@evanpurkhiser

Copy link
Copy Markdown
Owner

Thanks!

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.

2 participants