What HTTP statuses should a backend reject, and which should it resolve?

I’m updating the Dropbox backend to use OAuth2 refresh tokens, so the user doesn’t need to enter their password every four hours: Dropbox code needs to be updated to use refresh tokens · Issue #1267 · remotestorage/remotestorage.js · GitHub

I’m fixing bugs along the way, and it’s not clear what behavior BaseClient & Sync expect from the backend. Specifically, what HTTP statuses are they prepared to deal with?

I’ve gathered this from the wireclient code:

wireclient resolves statuses [401, 403, 404, 412]

wireclient resolves statuses [201, 204, 304] & 200 on GET

wireclient resolves all other statuses after using a heuristic to guess whether the response is text or binary.

wireclient rejects PUT & DELETE on folders

wireclient rejects on network error

wireclient rejects GET & PUT when not connected

wireclient throws error immediately on DELETE when not connected

wireclient rejects GET when folder description isn’t JSON

The policy generally appears to be ‘resolve if an HTTP status code was returned, otherwise reject’. The outlier is ‘wireclient rejects GET when folder description isn’t JSON’.