Skip to content
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

Handle zed.Union types in format.ts #3118

Merged
merged 2 commits into from
Jun 26, 2024
Merged

Handle zed.Union types in format.ts #3118

merged 2 commits into from
Jun 26, 2024

Conversation

philrz
Copy link
Contributor

@philrz philrz commented Jun 26, 2024

The changes in #3103 made it possible to smuggle a null union value into the Detail output formatter that was not prepared to handle them. After walking the code with @jameskerr, his suggestion was to back out the change from #3103 and instead add code in the Detail output formatter to handle unions in a way that's tolerant of null values. The attached video shows the fix working as intended with this PR's branch at commit 7807deb.

Demo.mp4

As it turns out, @jameskerr already had work underway to sunset this particular code in the Detail view in favor of what we do with Inspector, and he's already confirmed that new code is immune to this problem. However, since we took the time to fully understand what's wrong here, I figure it doesn't hurt to fix it so we're leaving the code in better shape as we lay it to rest, plus it'll let the #3117 community user work off a Zui Insiders release with the fix in the days leading up to the next GA Zui release.

Fixes #3117

Copy link
Member

@jameskerr jameskerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good.

@philrz philrz merged commit 09b7a36 into main Jun 26, 2024
4 checks passed
@philrz philrz deleted the null-union-detail-fix branch June 26, 2024 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"TypeError: Cannot read properties of null (reading 'isUnset')" when opening Detail view
2 participants