ably-js icon indicating copy to clipboard operation
ably-js copied to clipboard

Rest#request can't cope with an empty response body

Open SimonWoolf opened this issue 3 years ago • 6 comments

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)

┆Issue is synchronized with this Jira Bug by Unito

SimonWoolf avatar Jul 23 '20 13:07 SimonWoolf

@SimonWoolf - can you elaborate more, where did you encounter this error? on what environment? NodeJS, browser, react native?

vodolaz095 avatar Oct 12 '21 08:10 vodolaz095

on what environment? NodeJS, browser, react native?

node

SimonWoolf avatar Oct 12 '21 08:10 SimonWoolf

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...

https://scr.vodolaz095.life/s/tNZaRAlQP.png

vodolaz095 avatar Oct 12 '21 09:10 vodolaz095

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 avatar Oct 12 '21 09:10 vodolaz095

@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.

owenpearson avatar Oct 12 '21 09:10 owenpearson

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

!https://scr.vodolaz095.life/s/LmUozzjbX.png

vodolaz095 avatar Oct 12 '21 10:10 vodolaz095