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

pause react-queries when not connected #228

Open
SvenDowideit opened this issue Jul 14, 2022 · 0 comments
Open

pause react-queries when not connected #228

SvenDowideit opened this issue Jul 14, 2022 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@SvenDowideit
Copy link
Member

for react-query v3 - https://react-query-v3.tanstack.com/guides/disabling-queries

but v4 is soon, and has https://tanstack.com/query/v4/docs/examples/react/offline which will be superior.

IMO this can wait til 0.5.0, as its not a regression - but ... if you're not connected, you will (currently) see:

Failed to load resource: net::ERR_CONNECTION_REFUSED
127.0.0.1:8899/:1          Failed to load resource: net::ERR_CONNECTION_REFUSED
query.js:356 TypeError: Failed to fetch
    at ClientBrowser.callServer (connection.ts:1115:23)
    at ClientBrowser.request (index.js:102:8)
    at connection.ts:1154:14
    at new Promise (<anonymous>)
    at Connection._rpcRequest (connection.ts:1153:12)
    at Connection.getParsedTokenAccountsByOwner (connection.ts:2725:34)
    at getTokenAccounts (getAccount.ts:155:39)
    at Object.queryTokenAccounts [as queryFn] (getAccount.ts:170:31)
    at Object.fetchFn2 [as fn] (query.js:298:29)
    at run2 (retryer.js:95:31)
onError @ query.js:356
reject2 @ retryer.js:67
(anonymous) @ retryer.js:132
127.0.0.1:8899/:1          Failed to load resource: net::ERR_CONNECTION_REFUSED
query.js:356 TypeError: Failed to fetch
    at ClientBrowser.callServer (connection.ts:1115:23)
    at ClientBrowser.request (index.js:102:8)
    at connection.ts:1154:14
    at new Promise (<anonymous>)
    at Connection._rpcRequest (connection.ts:1153:12)
    at Connection.getParsedAccountInfo (connection.ts:2818:34)
    at getParsedAccount (getAccount.ts:47:36)
    at Object.queryParsedAccount [as queryFn] (getAccount.ts:76:29)
    at Object.fetchFn2 [as fn] (query.js:298:29)
    at run2 (retryer.js:95:31)
onError @ query.js:356
reject2 @ retryer.js:67
(anonymous) @ retryer.js:132
connection.ts:1115          POST http://127.0.0.1:8899/ net::ERR_CONNECTION_REFUSED
(anonymous) @ connection.ts:1115
ClientBrowser.request @ index.js:102
(anonymous) @ connection.ts:1154
(anonymous) @ connection.ts:1153
getEpochInfo @ connection.ts:3345
validatorState @ ValidatorNetwork.tsx:22
(anonymous) @ ValidatorNetwork.tsx:35
commitHookEffectListMount @ react-dom.development.js:23150
commitPassiveMountOnFiber @ react-dom.development.js:24926
commitPassiveMountEffects_complete @ react-dom.development.js:24891
commitPassiveMountEffects_begin @ react-dom.development.js:24878
commitPassiveMountEffects @ react-dom.development.js:24866
flushPassiveEffectsImpl @ react-dom.development.js:27039
flushPassiveEffects @ react-dom.development.js:26984
commitRootImpl @ react-dom.development.js:26935
commitRoot @ react-dom.development.js:26682
performSyncWorkOnRoot @ react-dom.development.js:26117
flushSyncCallbacks @ react-dom.development.js:12042
(anonymous) @ react-dom.development.js:25651
connection.ts:1115          POST http://127.0.0.1:8899/ net::ERR_CONNECTION_REFUSED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant