rusackas commented on code in PR #42530:
URL: https://github.com/apache/superset/pull/42530#discussion_r3664599963
##########
superset-frontend/plugins/preset-chart-deckgl/src/Multi/Multi.tsx:
##########
@@ -551,15 +561,12 @@ const DeckMulti = (props: DeckMultiProps) => {
);
if (deckSlicesChanged || visibilityFilterChanged) {
- // legacy explore_json payloads already carried the subslice metadata
- const legacySlices = payload?.data?.slices;
- if (legacySlices) {
- loadLayers(formData, legacySlices, visibleDeckLayersFromRedux);
- } else {
- fetchSubslices(ensureIsArray(formData.deck_slices) as number[]).then(
- slices => loadLayers(formData, slices, visibleDeckLayersFromRedux),
- );
- }
+ // deck_multi issues no query of its own (see buildQuery.ts), so each
+ // sub-slice's saved form_data is always fetched client-side here --
+ // there is no pre-merged payload to read subslice metadata from.
+ fetchSubslices(ensureIsArray(formData.deck_slices) as number[]).then(
+ slices => loadLayers(formData, slices, visibleDeckLayersFromRedux),
+ );
Review Comment:
Fair point, the generation guard only started once loadLayers ran, so a
slower fetchSubslices call could still clobber a newer one. Added a
fetch-generation ref around the effect so only the latest fetch can call
loadLayers.
--
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]