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

Refresh app state after successful save operation #346

Closed
4 tasks
GrzegorzBednarski opened this issue Mar 18, 2021 · 3 comments · Fixed by #357
Closed
4 tasks

Refresh app state after successful save operation #346

GrzegorzBednarski opened this issue Mar 18, 2021 · 3 comments · Fixed by #357
Assignees
Labels
enhancement New feature or request

Comments

@GrzegorzBednarski
Copy link
Collaborator

GrzegorzBednarski commented Mar 18, 2021

Problem description:

In order to prevent app inconsistency between the front-end and back-end, we need to make sure the app is refreshed when saved.

Solution:

After successful save operation on the backend - the event should be sent to all listeners (all open WebSocket connections).
The front-end should react to this event by requesting config.json again and reloading the app state.

Acceptance Criteria:

  • The Event is sent to all open WebSockets connections
  • Changes made on Cogboard opened in browser "A" are reflected on Cogboard opened on browser "B" and vice versa
  • We can see the app is calling config.json after The Event was sent on WebSocket
  • Page is not reloaded on this event it is just re-rendered
@GrzegorzBednarski GrzegorzBednarski added enhancement New feature or request good first issue Good for newcomers labels Mar 18, 2021
@szymon-owczarzak
Copy link
Contributor

I think we should do this a bit differently.
When config was saved, Instead of refreshing the page backend should send a special event to all listeners (open Cogboards) notifying them that they should refresh.
Refresh should just make a config call again and just reload the app state.

@GrzegorzBednarski
Copy link
Collaborator Author

Agreed

@szymon-owczarzak szymon-owczarzak removed the good first issue Good for newcomers label Mar 31, 2021
@szymon-owczarzak szymon-owczarzak changed the title Add refresh page after save Refresh app state after successful save operation Mar 31, 2021
@szymon-owczarzak
Copy link
Contributor

Agreed

In this case, I'm updating the description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants