-
Notifications
You must be signed in to change notification settings - Fork 351
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
make accessing query result records in ascii view type safe #1281
Conversation
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.
Great to see these kinds of changes 💯
@@ -124,7 +128,7 @@ function Stream(props: StreamProps): JSX.Element { | |||
stack: frameObject.stack | |||
} | |||
|
|||
let MyFrame = getFrame(frame.type) | |||
let MyFrame = getFrame(frame.type as FrameType) |
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.
Out of scope to change frame.type to avoid the cast?
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.
Yes, I tried but it was not trivial to share the type unfortunately
@@ -0,0 +1,89 @@ | |||
/* |
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 file had a long time coming, thanks! 🙏
# Conflicts: # src/shared/modules/requests/requestsDuck.ts
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.
Nice changes, merge on green!
A crash was reported when closing a frame while it is running a query, with a screenshot that showed a runtime type error when evaluating
result.records.length
when result was null. I was unable to recreate exactly the error in the screenshot, but could trigger a runtime type error when evaluatingresult.records.length
in ascii view by opening the text tab, re-running a query and closing the frame while the query was running.This PR fixes the potential type error in ascii view and also adds stricter typings to the ascii view component, requests duck file and other files connected to these files to make it easier to fix any other unknown type errors when evaluating query result in other components.
changelog: Fix bug when closing a frame with a running query