Skip to content
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 "Query Canceled" Error #584

Merged
merged 2 commits into from
Jan 15, 2025
Merged

Conversation

thostetler
Copy link
Member

This is happening because we pass the abortcontroller signal from react-query to axios allow it to cancel queries when components unmount or requests become stale.

I think in general it's okay to have this happen, but for some reason some of our components must unmount prematurely causing this unexpected behavior. This change makes sure react-query doesn't pass it's controller through.

React query is prematurely cancelling queries, this should stop that and allow for the queries to get cached
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

Attention: Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.

Project coverage is 66.2%. Comparing base (6ac05e1) to head (654fe4d).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/api/search/search.ts 50.0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #584     +/-   ##
========================================
+ Coverage    66.1%   66.2%   +0.1%     
========================================
  Files         197     197             
  Lines       22218   22199     -19     
  Branches      588     588             
========================================
- Hits        14686   14680      -6     
+ Misses       7523    7512     -11     
+ Partials        9       7      -2     
Files with missing lines Coverage Δ
src/api/author-affiliation/author-affiliation.ts 36.1% <100.0%> (+2.8%) ⬆️
src/api/export/export.ts 88.9% <100.0%> (-0.2%) ⬇️
src/api/orcid/orcid.ts 22.4% <100.0%> (+0.4%) ⬆️
src/api/reference/reference.ts 56.5% <100.0%> (+1.5%) ⬆️
src/api/resolver/resolver.ts 88.9% <100.0%> (-0.3%) ⬇️
src/api/user/user.ts 33.8% <100.0%> (+0.2%) ⬆️
src/api/vault/vault.ts 43.5% <100.0%> (+1.0%) ⬆️
src/components/BibstemPicker/BibstemPicker.tsx 62.7% <ø> (-0.1%) ⬇️
src/mocks/handlers.ts 100.0% <ø> (ø)
src/test-utils.tsx 88.0% <100.0%> (+0.8%) ⬆️
... and 1 more

... and 5 files with indirect coverage changes

@thostetler thostetler merged commit db2e63f into adsabs:master Jan 15, 2025
5 checks passed
@thostetler thostetler deleted the remove-abort-signal branch January 15, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants