Ignore stale responses in loadStatus when status reads overlap
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- electron, javascript, react
- Ambito
- frontend
Direzione di ricerca
Start in src/renderer/hooks/use-site-status.jsx and read loadStatus to see where each response writes state, metaPatchRef and statusLoading. Then follow the callers: the focus reload in index.jsx, the build-end reload in use-site-scripts.jsx, and the site:status handler in main.js that reads meta before Git. Done means a counter in a ref lets only the latest call apply its result, and the setup chain in index.jsx no longer acts on a superseded response.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
loadStatus in src/renderer/hooks/use-site-status.jsx applies every response it gets, in the order they come back. Two calls can overlap, for example the window-focus reload (index.jsx) and the reload a build's end triggers (use-site-scripts.jsx). If the older one finishes last, it puts back the state it read before the newer one.
What that can show:
buildFailed,installFailedorhasBuiltfrom before a build or install ended, so the setup checklist reads a failed build as complete, or the other way round.statusLoadingcleared by the older call while the newer one is still running.
site:status in main.js reads the site's meta before its Git reads, so an older call can read the meta before the outcome is written and still finish after the newer call.
Found by CodeRabbit on #716, which made buildFailed come from loadStatus like installFailed already does. It was deferred there because the race exists on trunk for the other fields too.
A likely fix: a request counter in a ref, applying the state, metaPatchRef and statusLoading only for the latest call. The callers that use the returned status (the setup chain in index.jsx) need checking too, so they don't act on a response that has been superseded.
- Lingua principale
- JavaScript
- Stelle
- 66
- Fork
- 20
- Merge medio
- 1g 18h
- PR unite (30g)
- 22
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un 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 WordPress/contributor-toolkit
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
WordPress/contributor-toolkit#762 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
WordPress/contributor-toolkit#747 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
WordPress/contributor-toolkit#746 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
WordPress/contributor-toolkit#741 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
WordPress/contributor-toolkit#726 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di WordPress/contributor-toolkit
Issue simili
-
from-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
andromarces/agent-loops#1928 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
laaielichter/AgentHaven#79 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/playwright#44109 ·
I maintainer di solito rispondono entro 1 giorno
-
Intl spec updatesApertaContent:JS goal: up-to-date needs BCD update
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno