fix(alerts/reports): misconfigured useEffect hook breaks form valida…#12779
Merged
Conversation
lilykuang
approved these changes
Jan 26, 2021
Codecov Report
@@ Coverage Diff @@
## master #12779 +/- ##
===========================================
- Coverage 66.68% 50.88% -15.80%
===========================================
Files 1021 477 -544
Lines 50008 17131 -32877
Branches 4905 4421 -484
===========================================
- Hits 33346 8717 -24629
+ Misses 16532 8414 -8118
+ Partials 130 0 -130
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
henryyeh
pushed a commit
to preset-io/superset
that referenced
this pull request
Jan 26, 2021
…ion in prod builds (apache#12779) (cherry picked from commit 3ed9151)
villebro
pushed a commit
that referenced
this pull request
Jan 29, 2021
…ion in prod builds (#12779)
qfcwell
pushed a commit
to qfcwell/superset
that referenced
this pull request
May 12, 2026
…ion in prod builds (apache#12779)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…tion in prod
SUMMARY
A misconfigured instance of the useEffect hook was causing the form validation to not run in prod builds.
I'm guessing
useEffecthas some performance optimizations to minimize updates in prod. Since this is first run with an empty array, react likely disregards subsequent updates after the component is mounted. Usually an error is thrown when react detects changes in the dependency array length. I think the initial empty array is an exception as that has slightly different semantics.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After:

TEST PLAN
ALERT_REPORTSfeature flagnpm run build)ADDITIONAL INFORMATION