Skip to content

Improve passing of ui_update.chartOptions to clients to prevent memory growing unrestricted#2129

Open
colinl wants to merge 1 commit into
FlowFuse:mainfrom
colinl:2012_dynamic_chart_options_grow_unrestricted
Open

Improve passing of ui_update.chartOptions to clients to prevent memory growing unrestricted#2129
colinl wants to merge 1 commit into
FlowFuse:mainfrom
colinl:2012_dynamic_chart_options_grow_unrestricted

Conversation

@colinl
Copy link
Copy Markdown
Collaborator

@colinl colinl commented May 24, 2026

Description

Currently if a sequence of msg.ui_update.chartOptions is sent to a chart these are pushed into an array so they can be replayed when required. This means that the memory usage can increase without bound if (for example) the user sends the chartOptions property with every sample. The ideal solution would be to import lodash.merge in the client code so that the client can keep a merged set of options as does the client, but the overheads of this are best avoided if possible.

This PR solves the problem by always sending the full merged set of chartOptions to the client whenever the message includes ui_update.chartOptions, which does slightly increase the comms overhead but this is unlikely ever to be significant. It also simplifies the code in the client.

Related Issue(s)

Closes #2012

See also PR #2013 to which this PR provides an alternative.

Checklist

  • [x ] 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
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

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

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.

Dynamic Chart options grow unrestricted

1 participant