Tons of errors are ignored
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
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- react-native, typescript
- Ambito
- cli
Direzione di ricerca
Inizia da isPackagerRunning.ts e segui ogni try/catch annidato intorno a fetch, ai dati della risposta e agli header. Confronta i casi segnalati di dati undefined e di errori imprevisti con gli esiti previsti running, not_running e unrecognized. Il lavoro è completo quando gli errori non vengono più ignorati silenziosamente o interpretati in modo errato e il comportamento viene reso visibile dove lo richiede l’issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hello. This bug is to keep track of a multitude of small issues where errors are silently ignored or misinterpreted. There are several pull requests fixing some of them already but this one does not appear to have a PR yet and is a great example. From isPackagerRunning.ts:
async function isPackagerRunning(
packagerPort: string | number = process.env.RCT_METRO_PORT || '8081',
): Promise<
| {
status: 'running';
root: string;
}
| 'not_running'
| 'unrecognized'
> {
try {
const {data, headers} = await fetch(
`http://localhost:${packagerPort}/status`,
);
try {
if (data === 'packager-status:running') {
return {
status: 'running',
root: headers.get('X-React-Native-Project-Root') ?? '',
};
}
} catch (_error) {
return 'unrecognized';
}
return 'unrecognized';
} catch (_error) {
return 'not_running';
}
}
Two issues here had me chasing false starts with another bug:
- Any error interpreting the data (e.g. data is undefined) is treated as
undefined. This will likely be wrong so at minimum there should be a visible by default warning in this scenario - Any issue during this entire process that isn't explicitly handles is treated as
not_running. Again this might be ok if the unrecognized error were visible, since that will not always be the correct thing to do
Bit of a side note with this snippet, there is a lot of unnecessary complexity that stems from the strange shape of this methods return type. We might want to make it something like
{status: 'running' | 'not_running' | 'unrecognized', root: string?}
and/or use an enum for the status. This is just "bug prone" not itself a bug, and we would need to refractor this area anyway, so let me know if we feel like this should be its own bug or if we should ignore it.
- Lingua principale
- TypeScript
- Stelle
- 2.9k
- Fork
- 948
- Merge medio
- 10g 19h
- PR unite (30g)
- 1
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 react-native-community/cli
-
run-ios --udid <physical device> throws "No simulator available" because the fallback simulator is resolved eagerlyForse già presa @huytdps13400 l’ha presa 41 giorni fa. Apertabug report
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
react-native-community/cli#2826 ·
I maintainer di solito rispondono entro 2 giorni
-
`project.ios.automaticPodsInstallation` default of `true` never applies unless `project.ios` is explicitly declared in `react-native.config.js`Forse già presa @huytdps13400 l’ha presa 41 giorni fa. Apertabug report
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
react-native-community/cli#2825 ·
I maintainer di solito rispondono entro 2 giorni
-
run-ios: "Unable to boot device in current state: Booted" alert when the simulator is already bootedForse già presa @bryandent l’ha presa 84 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
react-native-community/cli#2820 ·
I maintainer di solito rispondono entro 2 giorni
-
run-ios --buildFolder installs the app from the default DerivedData instead of the build folderForse già presa @lovisschmidt l’ha presa 1 giorno fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
react-native-community/cli#2869 ·
I maintainer di solito rispondono entro 2 giorni
-
run-ios on Xcode 27: DeviceHub opens no window when the simulator is shut downForse già presa @rakodev l’ha presa 2 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
react-native-community/cli#2866 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di react-native-community/cli
Issue simili
-
bot:ai-assisted status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
midnightntwrk/midnight-js#1424 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
mksglu/context-mode#1268 ·
I maintainer di solito rispondono entro 5 giorni
-
Edit:Apertacheck:failed streams:edit
Difficoltà 2/5 1-3 ore Idoneità per principianti 60/100
iptv-org/iptv#54352 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Table] reserveSelectedRowOnPaginate=false 时表头全选包含其他页数据Forse già presa @dvd233 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Tencent/tdesign-react#4416 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
area:widget bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
interledger/publisher-tools#894 ·
I maintainer di solito rispondono entro 1 giorno