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

Clients get out of sync from centralised datastore #679

Open
joepavitt opened this issue Mar 14, 2024 · 12 comments · May be fixed by #1463
Open

Clients get out of sync from centralised datastore #679

joepavitt opened this issue Mar 14, 2024 · 12 comments · May be fixed by #1463
Labels
bug Something isn't working priority:high High Priority size:M - 3 Sizing estimation point

Comments

@joepavitt
Copy link
Collaborator

Current Behavior

If you have two separate Dashboard clients open and connected to a centralised Node-RED instance with Dashboard 2.0, the server has a single source of truth.

If one client updates that data, e.g. through a toggle switch, the centralised store of data is updated. However, other clients are not aware of this change until they refresh, which is not the desired behaviour. Any clients connected should update if a client has been the driver of change (i.e. user clicks a toggle).

This already works for all instance where a node is injected with a new value.

Expected Behavior

All clients should reflect the server-side datastore at all times, unless using multi-user authentication/Dashboards architecture

Steps To Reproduce

  1. Add a toggle switch
  2. Open two browsers connecting to the Dashboard
  3. Toggle the switch on one of the clients
  4. Note that the other client doesn't automically update

Environment

  • Dashboard version: 1.4.0

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

@joepavitt joepavitt added size:M - 3 Sizing estimation point bug Something isn't working needs-triage Needs looking at to decide what to do labels Mar 14, 2024
@joepavitt
Copy link
Collaborator Author

This will require a little re-think of our underlying architecture, as this should just be working out of the box, but the events flow doesn't allow for it currently.

@joepavitt joepavitt moved this from Backlog to Up Next in Dashboard Backlog Mar 14, 2024
@joepavitt joepavitt added priority:high High Priority and removed needs-triage Needs looking at to decide what to do labels Mar 14, 2024
@colinl
Copy link
Contributor

colinl commented Mar 14, 2024

@uschmelmer
Copy link

Hi,
is there any progress on this issue?

Kind Regards

@joepavitt
Copy link
Collaborator Author

Sorry @uschmelmer - no updates on this currently

@joepavitt
Copy link
Collaborator Author

joepavitt commented Nov 12, 2024

So we use widget-change as an event to register a "change: of state. This event is found in:

  1. Button Group
  2. Dropdown
  3. Number Input
  4. Radio Group
  5. Slider
  6. Switch
  7. Text Input

I can make them all synchronise, but some of them feel odd to synchronise, particularly 7, and maybe even 2?

It's worth noting, we can disable this functionality at any time using the "Client Data" tab, which sets up each client/'browser as a unique session for a given widget type.

@joepavitt
Copy link
Collaborator Author

@colinl would really value your opinion here too?

@colinl
Copy link
Contributor

colinl commented Nov 12, 2024

I think they should all synchronise.
Text input is conceptually the same as number input, it just happens that one is entering text rather than a number.
Similarly a dropdown is just a text or number input with a limited set of values.

Watch out for the switch node when in 'show state of input' mode. It would be easy to break that I imagine.

@uschmelmer
Copy link

uschmelmer commented Nov 12, 2024 via email

@colinl
Copy link
Contributor

colinl commented Nov 12, 2024

Can you describe the use case for not wanting sync?

@uschmelmer
Copy link

uschmelmer commented Nov 12, 2024 via email

@joepavitt
Copy link
Collaborator Author

Can you describe the use case for not wanting sync?

In all of your internal Dashboards at FF, I would say we'd favour no syncing, but in the HMI use case on a Factory Floor, I can see the sync being favourable.

I built a first iteration today, ans it works very well, and utilises the existing "Client Data" tab, where you can check on/off syncing already, to decide whether to sync to different sessions or not.

@joepavitt joepavitt linked a pull request Nov 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:high High Priority size:M - 3 Sizing estimation point
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants