Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We need a way to detect that the connection to sbot is broken #29

Closed
2 tasks
soapdog opened this issue Jun 12, 2019 · 7 comments
Closed
2 tasks

We need a way to detect that the connection to sbot is broken #29

soapdog opened this issue Jun 12, 2019 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@soapdog
Copy link
Owner

soapdog commented Jun 12, 2019

Currently there is no way to detect when the connection to sbot is lost. The page just stops. A simple refresh will reestablish it but this currently requires the user to notice and do it. This is a bug,.

  • change online indicator in the avatar when connection is lost.
  • reestablish connection on the background.
@soapdog soapdog added the bug Something isn't working label Jun 12, 2019
@soapdog soapdog self-assigned this Jun 12, 2019
@cryptix
Copy link

cryptix commented Jun 12, 2019

I‘m relatively certain there is a reconnecting ssb-client already... at least I saw one once but might have been an old patchwork.. cc @mixmix

other than that I would just do a setInterval thing on sbot.whoami as a kludge?

@soapdog
Copy link
Owner Author

soapdog commented Jun 12, 2019

@cryptix omg that setInterval hack, I am definitely using that I think. I know that losing the connection causes an exception in the console. I just don't know where is the best place to trap it.

soapdog added a commit that referenced this issue Jun 12, 2019
soapdog added a commit that referenced this issue Jun 12, 2019
* This reduces the amount of full page refreshes that occurs while using the add-on.
* Adds an error view that can attempt to reconnect to _sbot_.

It still needs more work to solve #29 completely though.

closes #30
@mixmix
Copy link

mixmix commented Jun 13, 2019 via email

@soapdog
Copy link
Owner Author

soapdog commented Jun 15, 2019

@mixmix that does look like magic, I wish I understood pull-streams better. I am but a newbie regarding regarding them. That code is using depject and patchcore as well. I found it a bit hard to follow how it works, how pull-reconnect is supposed to be used. At the moment I've added some mitigation code to keep the connection up, attempting to reconnect once it detects that it is down or if nothing works presenting a nice error screen with options to solve it.

So far it appears to be working but I need to test more. Thanks ❤️ again for sending that code to me though. Depending on how it goes, I'll try to reassemble it into something more self contained or minimal in the future.

@soapdog
Copy link
Owner Author

soapdog commented Jun 15, 2019

Of course all the mitigation code just failed in my face while I was working in this message... This is how the error page looks:

Patchfox - Firefox Nightly 2019-06-15 12 58 11

At least clicking the try to reconnect option always work:

Patchfox - Firefox Nightly 2019-06-15 12 59 28

There is code in the background to attempt reconnection if that exact error is detected but apparently it didn't trigger.

@mixmix
Copy link

mixmix commented Jun 17, 2019 via email

@soapdog
Copy link
Owner Author

soapdog commented Aug 13, 2019

Breaking the connection causes an exception now. This is trapped. I'm trying to find a better way to handle it. I need to investigate pull-reconnect and see how to use it. I'm gonna close this issue as it is detectable now even though the fix is not up to the same quality as the UX in patchbay and patchwork.

@soapdog soapdog closed this as completed Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants