-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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: Filter throwing an error on Embedded Dashboard #21157
fix: Filter throwing an error on Embedded Dashboard #21157
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21157 +/- ##
==========================================
+ Coverage 66.36% 66.38% +0.02%
==========================================
Files 1781 1781
Lines 67871 67878 +7
Branches 7239 7242 +3
==========================================
+ Hits 45040 45064 +24
+ Misses 20973 20956 -17
Partials 1858 1858
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Thanks for investigating this @lilykuang.
Your current solution will generate the same id for different tabs. Unique tab ids are important to allow users to work on multiple tabs while isolating each tab's context. When working on this feature, the original solution stored the tab_id
in the URL to reuse it when available. We optimized it to use localStorage
to avoid the extra parameter but if there's no storage available we could do just that.
We could also create a utility function in src/utils/localStorageHelpers.ts
to check for storage availability.
function isStorageAvailable() {
try {
return window.localStorage && window.sessionStorage;
} catch (error) {
return false;
}
}
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.
LGTM
* fix: Filter throwing an error on Embedded Dashboard * use short_id if storage not available * avoid infinite loop (cherry picked from commit 604e30b)
* fix: Filter throwing an error on Embedded Dashboard * use short_id if storage not available * avoid infinite loop (cherry picked from commit 604e30b)
SUMMARY
when browser is set to block third-party cookies, the filter gets
SecurityError: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.
This pr is to fix this issueBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION