stephenLYZ commented on a change in pull request #16444:
URL: https://github.com/apache/superset/pull/16444#discussion_r695778058
##########
File path:
superset-frontend/src/dashboard/util/charts/getFormDataWithExtraFilters.ts
##########
@@ -68,13 +69,15 @@ export default function getFormDataWithExtraFilters({
// if dashboard metadata + filters have not changed, use cache if possible
if (
- (cachedFiltersByChart[sliceId] || {}) === filters &&
- (colorScheme == null ||
- cachedFormdataByChart[sliceId].color_scheme === colorScheme) &&
- cachedFormdataByChart[sliceId].color_namespace === colorNamespace &&
- isEqual(cachedFormdataByChart[sliceId].label_colors, labelColors) &&
+ cachedFiltersByChart[sliceId] === filters &&
+ (colorScheme === null ||
+ cachedFormdataByChart[sliceId]?.color_scheme === colorScheme) &&
+ cachedFormdataByChart[sliceId]?.color_namespace === colorNamespace &&
+ isEqual(cachedFormdataByChart[sliceId]?.label_colors, labelColors) &&
!!cachedFormdataByChart[sliceId] &&
- dataMask === undefined
+ areObjectsEqual(cachedFormdataByChart[sliceId]?.dataMask, dataMask, {
+ ignoreUndefined: true,
+ })
Review comment:
Agreed. Btw, Is it designed to not use the cache when the `colorScheme`
is `undefined`? Because previous logic that `colorScheme == null ` will return
true if it is `undefined` and go to next condition. In addition, the above
line of code seems that the `colorScheme` will not be null value whatever.
```
colorScheme: metadata?.color_scheme ?? undefined,
```
--
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]