Right now, behavior of on receiving HTTP 400 is to fail the job with “Unexpected response”. However, for OneDrive (and possibly GDrive) these are not entirely unexpected. API does return 400 once in a while for no apparent reason. I believe should do the usual retry logic on 400, I see no reason why it shouldn’t treat 400 the same as any other 400+ error outside of 401,404 and 409 that are handled separately.
The issue is mentioned in https://github.com/gilbertchen/duplicacy/issues/611.
The fix might be straightforward, too. Right now, ODB client runs retry after this check:
} else if response.StatusCode > 401 && response.StatusCode != 404 {
I think it should just be
} else if response.StatusCode >= 400 && response.StatusCode != 404 {
(>=400 check is not really needed, but is kept for clarity)
Thoughts?