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

Manage reconnection with Horizon server #22

Open
daniel-kratohvil opened this issue Aug 26, 2016 · 3 comments
Open

Manage reconnection with Horizon server #22

daniel-kratohvil opened this issue Aug 26, 2016 · 3 comments
Assignees
Milestone

Comments

@daniel-kratohvil
Copy link

@flipace thanks for this great project.

I’m also using your starter kit lovli.js but I’m having issues trying to reconnect with Horizon when the connections is interrupted. Right now the page goes blank when the connection is lost.

Any advice on how to reconnect with Horizon?

@flipace
Copy link
Owner

flipace commented Aug 26, 2016

Hi @itactica thanks for opening the issue here.

It was also mentioned in the lovli.js repo yesterday (flipace/lovli.js#16 (comment)) and I'll probably implement a small addition/change in horizon-react in order to make this easier.

i quote myself here: "as a possible workaround you can provide a prop "loadingComponent" which would be rendered in case of connection loss. alternatively we could implement a new prop which would prevent the connector from intervening when the connection is lost..."

@flipace flipace self-assigned this Aug 26, 2016
@flipace flipace added this to the v1.0 milestone Aug 26, 2016
@daniel-kratohvil
Copy link
Author

Thanks for your answer @flipace. I have implemented the loadingComponent and now I can display a message when the app is disconnected from Horizon. However, I would love to have a way to automatically reconnect again without refreshing the page. My ideal scenario would be:

  1. App connects with Horizon server
  2. In case of a disconnection horizon-react should try to reconnect several times automatically
  3. While horizon-react is trying to reconnect, the app should display the same content it had before loosing connection (we can show a message saying the connection has been lost if the user tries to load or submit data)
  4. If the reconnection is successful the App component should be re-rendered
  5. If the reconnection fails after x number of attempts a msg should be displayed.

I’m studying the code to better understand what’s happening under the hood and in case I come up with a solution I will let you know. Thxs again 💯

@flipace
Copy link
Owner

flipace commented Aug 26, 2016

Great detailed description of your wanted behaviour. I actually think we could really add this to horizon react since the data and queries are "cached" already..

Will think more about it when my kids are asleep 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants