Skip to content

fix: stabilize data engine context - #1445

Open
HendrikThePendric wants to merge 2 commits into
masterfrom
fix/prevent-rebuilding-data-engine-plugin-context
Open

fix: stabilize data engine context#1445
HendrikThePendric wants to merge 2 commits into
masterfrom
fix/prevent-rebuilding-data-engine-plugin-context

Conversation

@HendrikThePendric

@HendrikThePendric HendrikThePendric commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Implements N/A


Description

This is the problem I hit in the new event-visualizer-app:

  1. The dashboard sends a filter change. Our plugin gets new props over postMessage.
  2. PluginLoader calls setPropsFromParent. That re-renders the whole tree inside the iframe.
  3. DataProvider sits in that tree. Nothing above it is memoised, so it re-renders too.
  4. On every render, DataProvider runs new RestAPILink(config) and new DataEngine(link). So useDataEngine() hands out a different engine object than last render.

To avoid this, first we need to ensure config is as stable as possible, which we do by memoizing what we can in dhis2/app-platform#962. And with this stable config we can produce a stable context here.

While the changes in this PR rely on the fix in dhis2/app-platform#962, as well I wouldn't go as far as saying that these two PRs are fully interdependent. This code will run fine without the changes in app-platform. The issue won't be fixed, but it also won't be any worse than things currently are.

@sonarqubecloud

Copy link
Copy Markdown

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