-
-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve errors in Chart component #3262
base: master
Are you sure you want to change the base?
Improve errors in Chart component #3262
Conversation
@@ -171,12 +171,12 @@ export default function evalJsBindings( | |||
if (expression) { | |||
const computed = computationStatuses.get(expression); | |||
if (computed) { | |||
if (computed.result) { | |||
if (!computed.result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why some charts were showing errors before loading was because they were using a cached result here, but using this result didn't let them recognize that the query was still loading.
I changed it to not use the cache if there is an error in the result. There's probably a better solution?
@@ -171,8 +171,8 @@ function Chart({ data = [], loading, error, sx }: ChartProps) { | |||
|
|||
return ( | |||
<Box sx={{ ...sx, position: 'relative', height: '100%', width: '100%' }} aria-busy={loading}> | |||
{displayError ? <ErrorOverlay error={displayError} /> : null} | |||
{loading && !error ? ( | |||
{displayError && !loading ? <ErrorOverlay error={displayError} /> : null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just an adjustment, doesn't address any of the reported issues in this PR.
While looking a bit into propagating query errors to component binding results, ran into some semi-related issues in charts.
Edit: I moved this back into draft as I thought the fix wouldn't break any tests but it does. This logic is a bit complicated, I wasn't able to find a good solution so far / get to the root of the issue.
Before:
Screen.Recording.2024-02-29.at.18.55.14.mov
After:
Screen.Recording.2024-02-29.at.18.56.18.mov