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

[Feature]: change react query v4 network mode default to always #1442

Closed
gwansikk opened this issue Feb 19, 2025 · 7 comments · May be fixed by #1423
Closed

[Feature]: change react query v4 network mode default to always #1442

gwansikk opened this issue Feb 19, 2025 · 7 comments · May be fixed by #1423
Assignees
Milestone

Comments

@gwansikk
Copy link
Collaborator

gwansikk commented Feb 19, 2025

Package Scope

@suspensive/react-query-4

Description

changed the default network mode to "always" in react query v4.

Possible Solution

No response

etc.

Copy link

coauthors bot commented Feb 19, 2025

People can be co-author:

Candidate Reasons Count Add this as commit message
@manudeli #1442 (comment) #1442 (comment) #1442 (comment) #1442 (comment) 4 Co-authored-by: manudeli <61593290+manudeli@users.noreply.github.com>
@gwansikk #1442 (comment) #1442 (comment) #1442 3 Co-authored-by: gwansikk <39869096+gwansikk@users.noreply.github.com>

@manudeli
Copy link
Member

Let's do this feature as v3 BREAKING CHANGE

@manudeli manudeli added this to the v3 milestone Feb 21, 2025
@gwansikk gwansikk self-assigned this Feb 22, 2025
@manudeli
Copy link
Member

@gwansikk Could you make Pull Request for this issue please?
I think this should be tested by vitest in @suspensive/react-query-v4

@gwansikk
Copy link
Collaborator Author

gwansikk commented Feb 22, 2025

@gwansikk Could you make Pull Request for this issue please?
I think this should be tested by vitest in @suspensive/react-query-v4

Of course! I'll try to do it ASAP.

@manudeli manudeli linked a pull request Mar 2, 2025 that will close this issue
1 task
@manudeli
Copy link
Member

manudeli commented Mar 3, 2025

@gwansikk Let's do this issue urgently!

@gwansikk
Copy link
Collaborator Author

gwansikk commented Mar 3, 2025

@gwansikk Let's do this issue urgently!

This task will be completed by the end of today! I'm working on it.

@manudeli
Copy link
Member

manudeli commented Mar 3, 2025

Filling migration guide for this change is also important task. Keep it mind too please

manudeli added a commit that referenced this issue Mar 3, 2025
# Overview

closed: #1442 

In React Query v4, the `OnlineManager` checks the client's network
status using `navigator.onLine`. However, this can sometimes cause bugs
in Chrome (Chromium-based browsers), where the network is incorrectly
detected as offline even when it is online.

To minimize this issue, React Query v5 no longer relies on
`navigator.onLine`.

In React Query v4, to minimize this issue, **networkMode is set to
always in Suspense Hooks**. This change ensures that TData in Suspense
remains guaranteed.

ref:

-
https://github.com/TanStack/query/blob/v4/packages/query-core/src/onlineManager.ts#L92
- TanStack/query#4753
- https://issues.chromium.org/issues/338514113

## PR Checklist

- [x] I did below actions if need

1. I read the [Contributing
Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md)
2. I added documents and tests.

---------

Co-authored-by: Jonghyeon Ko <jonghyeon@toss.im>
@manudeli manudeli closed this as completed Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants