setusoft / silhouette-play-react-seed

A Silhouette Seed template which shows how Silhouette can be used to create a SPA with React/Redux and Play
MIT License
68 stars 21 forks source link

React goes for maintenance in offline mode #58

Closed orar closed 5 years ago

orar commented 5 years ago

The current relation of Health and Maintenance is health pulls from api and sets its isHealthy status to true or false. This contributes to causing maintenance mode.

Currently there are only 3 reducer actions for HealthModule: fetchHealth(Pending, Fulfilled, Rejected).

I add a fourth neutral action (fetchHealthFailed) which only sets healthy isPending state to false without altering the isHealthy status if response cannot be justified until connection is restored or app closed to cancel health polling.

Can start React app without Play server or simulate browser offline to reproduce.

akkie commented 5 years ago

If app goes offline, api response is not justified at that moment but an unhealthy action is issued which puts the app into maintenance mode.

This is the desired behavior. If the backend goes down, then the frontend cannot work properly. So it goes in maintenance mode.

orar commented 5 years ago

If Play is down, all functionalities of app are seized. This behavior will be least manifested by network partitioning or transient offline based on several network issues. I think it can be enhanced (maybe with retries or counter) a little to make concrete justification.

I'm closing this for now.