FormidableLabs / FormidableLabs/react-native-app-auth
App freezes when calling prefetchConfiguration with no internet connection
- Langage dominant
- Java
- Étoiles
- 2.3k
- Forks
- 473
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
## Issue
When calling prefetchConfiguration with device in airplane mode or with no internet connection the app freezes.
This is the error I get: E/AppAuth: Network error when retrieving discovery document.
config.js file
```js
import { prefetchConfiguration } from 'react-native-app-auth';
const config = {
warmAndPrefetchChrome: true,
issuer: 'https://login.microsoftonline.com/1caa43b8-bf09-48b6-9b3c-bd5a56fec019',
clientId: '5e0b7c9c-aaaa-472a-8ec6-6362c6d56fbe',
redirectUrl: 'msauth.com.rccl.oauth://auth/',
additionalParameters: {},
scopes: ['openid', 'profile', 'email', 'offline_access'],
};
prefetchConfiguration(config);
export default config;
```
Also tried using try/catch, still the app freezes.
```js
try{
prefetchConfiguration(config);
}catch (error) {
console.log(error);
}
```
## Environment
RN: 0.59.4
react-native-app-auth: ^4.4.0
* **Your Identity Provider**: Azure
* **Platform that you're experiencing the issue on**: both
* **Are you using Expo?** No
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par l’appel à prefetchConfiguration montré dans config.js et reproduisez-le sur les deux plateformes lorsque l’appareil est hors ligne. Suivez la manière dont l’erreur réseau est gérée, puis vérifiez que l’application ne se fige plus et que l’échec est observable par l’appelant.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript, react-native
- Domaine
- authentication, mobile
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100