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

fix(explore): undefined alteredControl value #22209

Conversation

justinpark
Copy link
Member

SUMMARY

Related to #20934 change, the following props.controls[controlName].value can be undefined when alteredControls are not existed on props.controls.

useEffect(() => {
if (props.chart.chartStatus === 'success') {
controlsTransferred?.forEach(controlName => {
const alteredControls = ensureIsArray(
props.controls[controlName].value,
).map(value => {

This commit fixes the following undefined property access error due to this change.

react-dom.production.min.js:209 TypeError: Cannot read properties of undefined (reading 'value')
    at ControlPanelsContainer.tsx:282:39
    at Array.forEach (<anonymous>)
    at ControlPanelsContainer.tsx:280:28
    at il (react-dom.production.min.js:211:320)

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

image (9)

After:

N/A

TESTING INSTRUCTIONS

  • click Create Chart in SQL Lab, it opens the explore view
  • runs the query by default
  • that query finished running is when I got this error and the UI broke

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

cc: @ktmud @john-bodley

@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Merging #22209 (35e8adf) into master (888f43c) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #22209      +/-   ##
==========================================
- Coverage   66.96%   66.96%   -0.01%     
==========================================
  Files        1835     1835              
  Lines       69927    69929       +2     
  Branches     7590     7591       +1     
==========================================
  Hits        46826    46826              
- Misses      21135    21137       +2     
  Partials     1966     1966              
Flag Coverage Δ
javascript 53.80% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../src/explore/components/ControlPanelsContainer.tsx 76.25% <0.00%> (-1.12%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@villebro
Copy link
Member

@justinpark @kgabryje is this a duplicate of #22207?

@justinpark
Copy link
Member Author

closed as duplicates

@justinpark justinpark closed this Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants