Skip to content

Conversation

@zorzysty
Copy link
Collaborator

@zorzysty zorzysty commented Nov 6, 2022

No description provided.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 6, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 37be96d:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-vue-basic Configuration

// 7. Observer options updated
// 8. Observer result updated -> stale
// 9. Observer options updated
expect(fn).toHaveBeenCalledTimes(9)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comments about the "9 updates" is still here, but the assertion is gone 🤔

I also don't know what the states.push are actually doing here. Nothing it seems.

I think this is one of the tests that should actually live in the query-core, not react-query. There is no nothing react specific about should notify query cache when a query becomes stale

we could do:

  • subscribe to queryCache
  • create an observer with a staleTime
  • do the same checks there ...

this would also get rid of the test duplication in solidJs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right, I'll give that a try

@codecov-commenter
Copy link

Codecov Report

Base: 96.36% // Head: 92.47% // Decreases project coverage by -3.88% ⚠️

Coverage data is based on head (2630a1f) compared to base (eab6e2c).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4466      +/-   ##
==========================================
- Coverage   96.36%   92.47%   -3.89%     
==========================================
  Files          45       88      +43     
  Lines        2281     3575    +1294     
  Branches      640      926     +286     
==========================================
+ Hits         2198     3306    +1108     
- Misses         80      253     +173     
- Partials        3       16      +13     
Impacted Files Coverage Δ
src/core/retryer.ts
src/core/mutation.ts
src/react/logger.ts
src/core/mutationObserver.ts
src/react/tests/utils.tsx
src/react/useBaseQuery.ts
src/react/useIsFetching.ts
src/devtools/tests/utils.tsx
src/react/utils.ts
src/react/useIsMutating.ts
... and 123 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@TkDodo TkDodo merged commit 71144c7 into TanStack:main Nov 6, 2022
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.

3 participants