NatLibFi / Skosmos

Thesaurus and controlled vocabulary browser using SKOS and SPARQL
Other
224 stars 94 forks source link

implement fetchWithAbort and use it for partial page load, mappings & alphabetical index #1609

Closed osma closed 6 months ago

osma commented 6 months ago

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 the fetch 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

Known problems or uncertainties in this PR

Checklist

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.58%. Comparing base (f22c504) to head (fcf5be7). Report is 5 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1609 +/- ## ========================================= Coverage 70.58% 70.58% Complexity 1647 1647 ========================================= Files 32 32 Lines 4321 4321 ========================================= Hits 3050 3050 Misses 1271 1271 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

osma commented 6 months ago

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.

sonarcloud[bot] commented 6 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud