ably-js
ably-js copied to clipboard
Rest#request can't cope with an empty response body
Not really a problem at the moment -- every endpoint that currently exists that we might use it for gives a response -- but still, a weird restriction and a spec violation (per HP1 it should be able to copy with an empty response)
@SimonWoolf - can you elaborate more, where did you encounter this error? on what environment? NodeJS, browser, react native?
on what environment? NodeJS, browser, react native?
node
I added checks to empty or unparsable server responses here: https://github.com/ably/ably-js/pull/817/files#diff-425be7c2626b14bcb32fe69e05f2f6ba7cf7959b730007f1346341fabe75516cR35
When i have pushed code to PR, it seems to pass nodejs unit tests https://github.com/ably/ably-js/pull/817/checks?check_run_id=3868202654 https://github.com/ably/ably-js/pull/817/checks?check_run_id=3868202719
but it fails with playwright - testing using browser. Issue is - i haven't altered anything with browser, so seems like my PR fixed issue, but build fails for code i didn't altered...
this test seems to fail on all playwright based tests:
https://github.com/ably/ably-js/pull/817/checks?check_run_id=3868202660#step:6:667
@vodolaz095 that link doesn't work for me but I know the test you're talking about. We've discussed it briefly here and it's just a bug in the backend API so we can ignore it.
Unfortunately the tests are somewhat flakey so even when that's fixed the browser tests will still fail fairly often, you can run the tests locally with mocha HTML reporter by running npm run test:webserver
and opening localhost:3000 in a browser of your choice. If you get a failing test there you can re-run it by clicking on the failing test so that's currently the best strategy for checking whether a test is consistently failing or just flakey.
yes, i tried running tests in browser, but seems like i need to set credentials to access abbly servers in order to ran them properly, i'll research on it