-
Notifications
You must be signed in to change notification settings - Fork 95
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
implement fetchWithAbort and use it for partial page load, mappings & alphabetical index #1609
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1609 +/- ##
=========================================
Coverage 70.58% 70.58%
Complexity 1647 1647
=========================================
Files 32 32
Lines 4321 4321
=========================================
Hits 3050 3050
Misses 1271 1271 ☔ View full report in Codecov by Sentry. |
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.
The code looks good to me and it seems to work correctly.
Cypress tests for partial page load on vocabulary home page fail sometimes because timeout isn't high enough. Not sure if the problem should be addressed in here, though, as it doesn't seem to originate from this PR.
You are right @UnniKohonen . I will increase the timeouts. I think it makes sense to do this on this PR branch rather than makkng a separate PR because the timeout problem is closely related even though it's probably not caused by new changes in this PR. |
Quality Gate passedIssues Measures |
Reasons for creating this PR
Trying to address the AJAX race conditions related to partial page load (#1561).
This PR defines a new JS function
fetchWithAbort
that wraps thefetch
method but also keeps track of pending fetches (per category - there can be different categories) and aborts them early when it's called again.Link to relevant issue(s), if any
Description of the changes in this PR
fetchWithAbort
fetchWithAbort
when performing partial page load and also when loading mappings for the concept pagefetchWithAbort
when loading entries for the alphabetical indexKnown problems or uncertainties in this PR
Checklist
.sr-only
class, color contrast)