App-wide offline handling: every other mutation still pauses silently while offline
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- frontend, observability
Direzione di ricerca
Start with src/features/auth/failFastOffline.ts to see how networkMode: 'always' and OfflineSubmitError are applied, then find the QueryClient defaults and the global errorHandler. The issue asks for a decision first: a shared mutation default, an offline indicator, or both, so confirm the choice with maintainers before editing. Done means an offline mutation fails fast with a "You're offline" message, offline failures never reach console.error, and the auth behaviour from #1930 still passes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-up to #1930. That issue fixed the auth forms only.
Problem
React Query's default networkMode is 'online', for queries and for mutations. While onlineManager reports offline, a mutation is paused before its mutationFn runs. isPending and isPaused are both true, nothing is sent, and nothing fails. A query is held in fetchStatus: 'paused'. Studio never renders isPaused anywhere, so every submit button bound to isPending spins with no message for as long as the browser is offline. When the connection comes back, the paused request is sent, often after the person has given up or moved on.
#1930 moved every auth mutation to failFastOffline (src/features/auth/failFastOffline.ts: networkMode: 'always', plus an OfflineSubmitError that the forms show as "You're offline…"). Before that, the only other mutation to opt out was useAddDomainToOrganization (networkMode: 'always'). The rest of the app still uses the default:
- Organization: create/delete organization, add/edit/delete role, add/remove user from a role, invite or re-invite a user, coupon, delete domain, attach a payment method, the Stripe intent mutations, profile update, organization OAuth settings.
- Clusters: create/edit cluster, set domains on a cluster, terminate, container start/stop/restart, Finish Setup (
useInstanceResetPasswordMutation). - Instance config: users, roles, certificates, SSH keys and known hosts, secrets and grants, OIDC trust policies, instance status and restart.
- Applications: add from template, import/redeploy/activate a staged release, package/download, set file, env values, drop component.
- Databases: create/delete database and table, insert/put/update/delete records, CSV/import, orphan-blob cleanup.
- Admin: API tokens, notifications, regions.
- Navbar sign-out (
useLogoutMutation). Left out of #1930 because it also runs the instance sign-out sweep.
The full per-hook list is in #1937, the PR that closes #1930.
One case is worth checking separately. Local Studio (isLocalStudio) talks to the instance that serves it, often on localhost, which still answers when the machine has no network. React Query gates on the browser's online signal, not on whether the target can be reached. So if the connection drops while local Studio is open, every query and mutation pauses, even though the instance is still reachable.
Options
- A shared default. Set
networkMode: 'always'in theQueryClient'sdefaultOptions.mutations, and possibly for queries too. Pair it with an offline classification likefailFastOffline's, so that the globalerrorHandlertoasts "You're offline" rather than "Outcome unknown" for a request sent while offline, and logs it withconsole.debugrather thanconsole.error(RUM, #1669). For queries,'always'loses the automatic refetch when the connection returns, so this may only be right for mutations. - A global offline indicator. A banner bound to
onlineManagerthat says requests are paused until the connection returns. This keeps the default and its automatic resume, but it can't fix a paused submit that has already been abandoned and still fires later. - Both: fail fast on mutations, keep pausing queries, and show the indicator so a paused query reads as "offline" rather than "loading".
Whichever is chosen, keep #1930's rule that an offline failure never reaches console.error.
- Lingua principale
- TypeScript
- Stelle
- 5
- Fork
- 4
- Merge medio
- 1g 19h
- PR unite (30g)
- 144
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di HarperFast/studio
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
HarperFast/studio#2070 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
HarperFast/studio#2067 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
HarperFast/studio#2053 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
HarperFast/studio#2026 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
HarperFast/studio#2021 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di HarperFast/studio
Issue simili
-
area: build-and-ci S3: minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
manaflow-ai/cmux#39902 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
refined-github/refined-github#10387 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
CopilotKit/CopilotKit#8283 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
complexity:simple priority:P3 ready-to-build
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
junruxiong/IncarnaMind#2919 ·