-
Notifications
You must be signed in to change notification settings - Fork 919
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(discover): disable cache only on indexPatterns.get
to prevent crash
#7926
fix(discover): disable cache only on indexPatterns.get
to prevent crash
#7926
Conversation
…rash Signed-off-by: Joshua Li <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7926 +/- ##
=======================================
Coverage 64.29% 64.29%
=======================================
Files 3674 3674
Lines 81149 81149
Branches 12928 12928
=======================================
+ Hits 52173 52175 +2
+ Misses 25765 25764 -1
+ Partials 3211 3210 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
do we know if this works fine with indices on load? |
the fields from the last index-pattern search are showed on the left when searching indices, seems to be another bug. for testing i searched the index with the same fields, and adding/removing fields worked |
Spoke to @joshuali925; the |
adding some context, i sent this PR because page crash affects user experience and i want to fix it for 2.17. this seems to be the easiest fix, i'm not sure what is the best fix |
Spoke to Rocky offline:
|
…rash (#7926) Signed-off-by: Joshua Li <[email protected]> (cherry picked from commit 5115b1c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…rash (#7926) (#7976) (cherry picked from commit 5115b1c) Signed-off-by: Joshua Li <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Right now in new discover, if user adds/removes two fields on the left quickly, it will crash with
console error
I believe this happens because cache is being updated when user adds a field, and the index pattern is not available in the cache during the update.
OpenSearch-Dashboards/src/plugins/discover/public/application/helpers/popularize_field.ts
Lines 45 to 49 in a9f84be
If user adds another field when cache is not available, the index pattern will be undefined, and calling
undefined.type
crashes the pageOpenSearch-Dashboards/src/plugins/data/common/index_patterns/lib/is_default.ts
Lines 33 to 36 in a9f84be
Issues Resolved
Screenshot
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration