dosubot[bot] commented on issue #40708: URL: https://github.com/apache/superset/issues/40708#issuecomment-4612328541
<!-- Answer --> Hi @lliudspace! I'm [Dosu](https://go.dosu.dev/dosubot) and I'm helping the Apache Superset team. This is a confirmed bug area that's been reported by multiple users and acknowledged by maintainers as unintended behavior [[1]](https://github.com/apache/superset/issues/38514#issuecomment-4022881273). The root cause is a **race condition in the color initialization pipeline** — charts that render before `applyDashboardLabelsColorOnLoad()` finishes applying the dashboard metadata's `label_colors` to the `CategoricalColorNamespace` will fall back to the chart's `color_scheme` palette instead [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx). The dashboard color system has multiple timing-sensitive initialization phases [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx#L232-L247): 1. Dashboard load sets the `LabelsColorMapSource.Dashboard` mode 2. `applyDashboardLabelsColorOnLoad()` pushes your `label_colors` into forced colors 3. Charts render and request colors — if step 2 hasn't completed, they get palette colors instead 4. A final sync (`ensureSyncedSharedLabelsColors()`) runs after all charts finish, which is why interaction/refresh fixes things **Recent fixes in this area:** - [PR #39297](https://github.com/apache/superset/pull/39297) (merged May 2026) addresses a related collision race condition when dashboard-locked colors conflict with palette-assigned colors during rendering. It introduces a `AvoidColorsCollision` feature flag that detects and reassigns conflicting colors. **Workarounds:** 1. **Clear accumulated color metadata** via the dashboard colors API, then re-save your dashboard with only your intended `label_colors`: ```bash curl -X PUT "http://your-superset-instance/api/v1/dashboard/{dashboard_id}/colors" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer {your_token}" \ -d '{ "label_colors": {"60_Crashed":"#8b0000","50_Error":"#ff0000","40_Failed":"#ff8c00","30_Undefined":"#ffd700","20_Passed":"#008000","10_Executed":"#0000ff","01_Invalid":"#ff00ff","00_NoResult":"#808080"}, "shared_label_colors": [], "map_label_colors": {}, "color_scheme": "", "color_scheme_domain": [] }' ``` 2. **Check for stale `shared_label_colors` or `map_label_colors`** in your dashboard's JSON metadata — these can accumulate over time and interfere with your explicit `label_colors` definitions. To confirm: your hypothesis about rendering order/timing is correct. This isn't an expected limitation but rather a known gap in the initialization sequencing. A maintainer noted this area is "constantly being looked at" and will likely see a larger reinvention at some point [[1]](https://github.com/apache/superset/issues/38514#issuecomment-4022881273). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=51a32041-cf4a-44a3-bb5d-32d4b5a6bf48) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
