You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Octokat returns an empty string when connection is refused #1522
I added an entry to my hosts file to stop all trafic to api.github.com and then tried to launch the app. It didn't work.
Turns out that when a request in Octokat fails du to a connection refused error the only thing we get back is an empty string. No error, no nothing.
This is even more disconcerting given that the whole octokat client is untyped (any) so we tell blatant lies to the type system.
Take this example
We assert that we return a readonly array of emails when in fact we might end up returning an empty string if there's a connection error.
We probably need to go fix this in octokat and then make sure that we deal with the ensuing errors because right now we're hiding potential incoherent state.
I'll open up a PR shortly to take work around the blockers that prevent the app from launching but we'll need a better strategy for this, and soon.
We probably need to go fix this in octokat and then make sure that we deal with the ensuing errors because right now we're hiding potential incoherent state.
👍 they've been pretty great at taking in our changes already, so I think they'd be open to improving this as well
philschatz/octokat.js#170 switches Octokat to use the fetch API directly which might help with this problem. You can test it by using the pre-release versionv0.9.0-0.
If that does not work, I will probably need to switch Octokat to yield an object that contains:
the Response object
any parsed headers (like rate_limit and Link: headers needed for pagination)
and the result
Those would be breaking changes but I could probably fix up desktop.
It may take a little while to make those changes since I work on Octokat in my spare time.
Regarding typescript definitions, that would be a great feature; I can try that once the response.status == 0 is working for you.
Reacted by Riley Labrecque, Markus Olsson, Josh Abernathy and William Shepherd
Activity
shiftkey commentedon May 16, 2017
👍 they've been pretty great at taking in our changes already, so I think they'd be open to improving this as well
philschatz commentedon May 19, 2017
Howdy! I'm the developer of Octokat.
philschatz/octokat.js#170 switches Octokat to use the
fetchAPI directly which might help with this problem. You can test it by using the pre-release versionv0.9.0-0.If that does not work, I will probably need to switch Octokat to yield an object that contains:
Responseobjectrate_limitandLink:headers needed for pagination)Those would be breaking changes but I could probably fix up
desktop.It may take a little while to make those changes since I work on Octokat in my spare time.
Regarding typescript definitions, that would be a great feature; I can try that once the
response.status == 0is working for you.niik commentedon May 19, 2017
@philschatz Switching to fetch sounds like a wonderful plan, thanks for letting us know about it!
shiftkey commentedon May 25, 2017
Updating to
0.9.0-1seems to yield better errors from thefetchAPI:@niik was this how you were testing the behaviour? Or is there something else I should do in here?
shiftkey commentedon May 25, 2017
Picking this one up as I think updating to
0.9.0will help hereniik commentedon May 26, 2017
Yup, that's exactly how I was doing it