Skip to content

Dashboard data store - Warn when the context store can't hold a live proxy [2/3] - #2230

Open
n-lark wants to merge 6 commits into
249-data-storefrom
249-data-store-cache-off
Open

n-lark wants to merge 6 commits into
249-data-storefrom
249-data-store-cache-off

Conversation

@n-lark

@n-lark n-lark commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Description

The global.dashboardStore store is a Proxy, which is behavior rather than data, so it quietly stops working in two situations. This layer catches both and warns instead of failing silently.

1️⃣ Cache-off context store

A persistent context store with cache: false keeps no in-memory copy, so every read hands back plain data with the proxy stripped. isInMemoryBacked() probes for this up front, and ui-base injects the store only when it is safe, otherwise it warns.

2️⃣ Replacement

global.set('dashboardStore', <anything>) discards every widget's stored value. attachToContext remembers the store it injected, per context, so it catches any replacement, including undefined and primitives, which a shape check misses. Then re-creates the store, rehydrates any plain data, and calls onReplaced. A restart rehydrating plain data is not a replacement, so it stays quiet.

Related Issue(s)

Relates to #2236

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

Labels

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

@n-lark n-lark self-assigned this Sep 15, 2026
@n-lark
n-lark added this pull request to stack #2231 September 15, 2026 20:05
@n-lark n-lark changed the title Dashboard data store - Warn when the context store can't hold a live proxy Dashboard data store - Warn when the context store can't hold a live proxy [2/3] Sep 15, 2026
@n-lark
n-lark marked this pull request as ready for review September 17, 2026 20:27
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.

1 participant