Skip to content

Reconnect all clients when flows are redeployed #1700

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

Merged
merged 4 commits into from
May 21, 2025
Merged

Conversation

luisthieme
Copy link
Contributor

Description

Not a perfekt solution but it works.

Related Issue(s)

Closes #870

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Includes a DB migration? -> add the area:migration label

@joepavitt
Copy link
Collaborator

Thanks @luisthieme - we'll get this reviewed and hopefully merged this week

@joepavitt joepavitt requested a review from Steve-Mcl May 14, 2025 08:51
@Steve-Mcl
Copy link
Contributor

Hmm, some odd, probably unrelated test fails...

  7 passing (17s)
  1 failing

  1) Node-RED Dashboard 2.0 - Buttons
       Button 1 (bool) outputs a bool payload & topic from msg.topic:

      Timed out retrying after 4000ms
      + expected - actual

      +'msg.topic from inject-1'
      
      at Context.eval (webpack://@flowfuse/node-red-dashboard/./cypress/support/commands.js:123:75)
  9 passing (29s)
  2 failing

  1) Node-RED Dashboard 2.0 - Control - Show/Hide
       can hide and show a particular page from the navigation options:

      AssertionError: Timed out retrying after 4000ms: Too many elements found. Found '3', expected '2'.
      + expected - actual

      -3
      +2
      
      at Context.eval (webpack://@flowfuse/node-red-dashboard/./cypress/tests/widgets/control.spec.js:91:48)

  2) Node-RED Dashboard 2.0 - Control - Enable/Disable
       can enable/disable a particular page from the navigation options:

      AssertionError: Timed out retrying after 4000ms: Not enough elements found. Found '2', expected '3'.
      + expected - actual

      -2
      +3

@joepavitt joepavitt merged commit fcbec23 into FlowFuse:main May 21, 2025
2 checks passed
@cgjgh
Copy link
Contributor

cgjgh commented May 25, 2025

Has anyone else had an issue with this doing the opposite, (clients not reconnecting) or is it just me? Some of my clients do not reconnect unless I reload the page, whereas when removing this change, clients are reconnecting flawlessly.

@joepavitt
Copy link
Collaborator

@cgjgh under what circumstances are your clients disconnecting in the first place?

@cgjgh
Copy link
Contributor

cgjgh commented May 26, 2025

@cgjgh under what circumstances are your clients disconnecting in the first place?

@joepavitt It happens when Dashboard is open in webpage and you deploy flows. All clients disconnect as before, but with new code some do not reconnect. I have not done any extensive testing, but just noticed that removing code made everything work flawlessly.

@joepavitt
Copy link
Collaborator

All clients disconnect as before, but with new code some do not reconnect. I have not done any extensive testing, but just noticed that removing code made everything work flawlessly.

The initial bug report was, on a deploy, clients do not reconnect. Are you saying that has never been an issue for you?

So that I can push a release out, I will revert these changes. We'll do a more thorough review and then do a follow up release (hopefully) with this included.

@cgjgh
Copy link
Contributor

cgjgh commented May 26, 2025

@joepavitt The referenced issue #870 specifically mentions ui-control behavior. I may have had this issue as well, and this PR may have fixed this, but the behavior I was describing with this change seems to be a broader issue, as after deploys socket does not reconnect (correctly at least, as browser console outputs “SIO connected” but no config is being received as per usual). Reloading page reconnects socket correctly.

To sum it up, another issue seems to have been introduced. Will need further testing to fully understand it.

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

Successfully merging this pull request may close these issues.

Ui-Control behaviour upon Depoly
4 participants