-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fixes and improvements to history views #1484
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
Conversation
- Allow refreshing while requests are still happening by using a list of dict.items() - Fixed issue with `history_refresh`, it now returns SignedDataForm to allow Switch requests to work after refresh. - Clean up old rows in FE from that have now expired when refresh happens. - Fixed `history_sidebar` view to not raise 500 error when no toolbar is found for an expired `store_id`. - Old rows that have now expired, display [EXPIRED] next to the Switch text.
Codecov Report
@@ Coverage Diff @@
## main #1484 +/- ##
==========================================
- Coverage 86.43% 86.40% -0.04%
==========================================
Files 35 35
Lines 1858 1861 +3
Branches 261 262 +1
==========================================
+ Hits 1606 1608 +2
- Misses 179 181 +2
+ Partials 73 72 -1
Continue to review full report at Codecov.
|
I think this looks good. I'm not sure about the change from |
I'm a bit swamped this week, but I will try to review this on Thu/Fri. |
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.
Thank you for the PR, there's a lot of great stuff in here! Having the additional context of expired switches will be helpful.
I'm not sold on the need to switch away from the HistoryStoreForm
though. If we don't need to use the SignedDataForm
, then I'd prefer to not use that.
I'm also curious if it's possible to write a test to cover the case of parallel operations mutating the store and causing it to break. How did you encounter that case originally?
@tim-schilling Thanks for your review. With the above changes the switch URLs(even after refresh) look like this: If we use Dict mutation test: It's quite tricky to prove in a test. But here's an attempt in my fork https://github.com/ashwch/django-debug-toolbar/tree/dict_mutation_test: https://github.com/ashwch/django-debug-toolbar/blob/c0454b6c20e09b0db8d1d3eae67429cd7eb07bb3/tests/panels/test_history.py#L138. The sleep time of
|
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.
Thank you for the changes and further explanation. After pulling the PR and running the tests myself, it finally clicked. You're absolutely correct we should be wrapping the form should be a SignedDataForm
instance, but we should still by supplying the HistoryStoreForm().initial
rather than bypassing it. The purpose for this is if we ever change HistoryStoreForm
's shape in the future, that will be included. Otherwise we'd have to remember to also make the change here off of pure memory which I'm probably going to fail at.
I've made the change to your branch. I'm good with these changes, thank you for the PR!
12d0a14
to
8049478
Compare
Thanks, both of you! I think this looks good. Let's merge this. |
using a list of dict.items()
history_refresh
, it now returns SignedDataFormto allow Switch requests to work after refresh.
happens.
history_sidebar
view to not raise 500 error when no toolbaris found for an expired
store_id
.Switch text.
Fixes #1483