gitpoint / gitpoint/git-point

Login problem since RN 0.59

Abierto
#913 0 comentarios 0 reacciones 0 asignados Ver en GitHub
:bug: bug
Lenguaje dominante
JavaScript
Estrellas
4.8k
Forks
771
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### Backgrounds

The current designed login process,

1. In login screen, visit Github's login url with a callback schema by WebView and listen to `onNavigationStateChange`
- Before #323, use `Linking` in Android and `react-native-safari-view` in iOS, then listen on Linking in both platforms
- Why still listening on Linking in Android? Because in Android, we have a `can't login` button
2. If succeed to login, it will,
1. jump to the schema, `gitpoint://welcome`, which means the welcome screen
2. trigger onNavigationStateChange to get the auth, and navigate to `Main`

I guess the stack navigator guarantees the main screen will always on the top of the welcome screen.

### Problem

I tested different versions of codes and found that starting from #883, with RN 0.59,

- In iOS, onNavigationStateChange is not triggered for the schema
- In Android, every onNavigationStateChange is triggered but Main can't cover Welcome

Users will be blocked by the welcome screen after login in. The workaround is killing the app and open again. It has logged in so will navigate to the main screen at the second time.

### Related

- No tag for v1.6.0, according to translation texts, it should be > 1716618 and < ecb61fa
- The most likely commit is 67a17ae
- Used try to make `Welcome` be able to navigate to `Main`(35e4a08)
- Works well in iOS, it will only try to auth in the welcome screen
- But in Android, it will try to auth twice (both in login and welcome screen)

Future direction should be replacing the WebView login with native implementations.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza revisando los cambios relacionados con #883 y los commits 67a17ae y 35e4a08; después, reproduce el flujo de inicio de sesión en iOS y Android con React Native 0.59. Se considera terminado cuando un inicio de sesión correcto llega a Main sin requerir reiniciar la aplicación y no activa la autenticación dos veces.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, react-native
Área
authentication, mobile
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.