Skip to content

fix: validate JSON from other devices without dropping unknown fields - #85

Merged
gmaclennan merged 2 commits into
refactor/adapter-router-fetchfrom
fix/validate-remote-json
Oct 23, 2026
Merged

gmaclennan merged 2 commits into
refactor/adapter-router-fetchfrom
fix/validate-remote-json

Conversation

@gmaclennan

Copy link
Copy Markdown
Member

The receiver's status check copied the sender's share status straight into the download state, so a sender still reporting 'downloading' left the download stuck there, and 'pending' or a status from a newer version became an invalid download state. Only 'canceled' and 'error' are now taken from the sender; anything else keeps the receiver's own error.

Error responses from the sender become a RemoteStatusError whose code and message are always strings, and whose unknown properties are kept for error reporting. A non-JSON body keeps its HTTP status in the message, a 'proto' key can no longer replace the error's prototype, and an error named 'AbortError' from the sender is no longer mistaken for a local abort.


Stack created with GitHub Stacks CLI • Give Feedback 💬

The receiver's status check copied the sender's share status straight into the download state, so a sender still reporting 'downloading' left the download stuck there, and 'pending' or a status from a newer version became an invalid download state. Only 'canceled' and 'error' are now taken from the sender; anything else keeps the receiver's own error.

Error responses from the sender become a RemoteStatusError whose code and message are always strings, and whose unknown properties are kept for error reporting. A non-JSON body keeps its HTTP status in the message, a '__proto__' key can no longer replace the error's prototype, and an error named 'AbortError' from the sender is no longer mistaken for a local abort.
@gmaclennan
gmaclennan added this pull request to stack #87 October 23, 2026 21:56
RemoteStatusError exposed its details through a getter, so a sender error body with its own 'details' key threw a TypeError when copied onto the error, and the sender's error was lost. The details are now read with RemoteStatusError.details(error).
@gmaclennan
gmaclennan merged commit 6beddcc into main Oct 23, 2026
8 checks passed
@gmaclennan
gmaclennan deleted the fix/validate-remote-json branch October 23, 2026 22:06
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.

1 participant