-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(bootstrap-data): always check flashes #22659
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22659 +/- ##
==========================================
- Coverage 66.88% 65.62% -1.27%
==========================================
Files 1859 1869 +10
Lines 71103 71524 +421
Branches 7782 7814 +32
==========================================
- Hits 47557 46937 -620
- Misses 21520 22546 +1026
- Partials 2026 2041 +15
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 |
3bb7147
to
eaf7a3d
Compare
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 the fix, LG%small nit
superset/embedded/view.py
Outdated
@@ -77,7 +77,7 @@ def embedded( | |||
) | |||
|
|||
bootstrap_data = { | |||
"common": common_bootstrap_payload(g.user), | |||
"common": common_bootstrap_payload(), |
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.
I would suggest to keep user as an argument here, last time I made a bug and assumed that common_bootstrap_payload was user agnostic as it did not take any params
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.
Good point, I'll reintroduce it 👍
SUMMARY
#21018 and #21439 added memoization of common bootstrap data to avoid repetitive calls to regenerate user perms in bootstrap data. However, this had the side-effect of also using cached toasts, causing toasts to either 1) not display 2) display with a lag and not clear.
This breaks out the expensive logic from
common_bootstrap_payload
into a separate functioncached_common_bootstrap_data
which is memoized, and always checks flashed messages to ensure that they always accurately reflect the current toasts.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION