Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Boilerplate: a sign-out is skipped after a sign-in whose push subscription got a 429 (AppClientCoordinator)

Abierto Apto para principiantes
#14,428 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp, wasm

Línea de trabajo

Empieza por AppClientCoordinator.PropagateAuthState en la plantilla Boilerplate y sigue cómo se actualiza lastPropagatedUser cuando la suscripción push devuelve 429. Comprueba las pruebas de propagación del estado de autenticación, si las hay, y añade cobertura para cerrar sesión después de esa devolución anticipada. Se considera terminado cuando cerrar sesión actualiza el estado de autenticación de SignalR y la telemetría del usuario, y se vuelve a intentar la suscripción push para el estado anónimo.

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

Descripción

Describe the bug

In the Boilerplate template (10.7.0, still the same on develop), AppClientCoordinator.PropagateAuthState returns early when the push subscription gets a 429, without setting lastPropagatedUser:

if (await pushSubscription is false)
    return;

lastPropagatedUser = user;

lastPropagatedUser is then still the user propagated before this one. When that was the anonymous user, the next sign-out is skipped entirely:

  1. The app starts signed out. lastPropagatedUser is the anonymous principal.
  2. The user signs in. PushNotificationController is rate limited (EnableRateLimiting(PUSH_NOTIFICATION)), so Subscribe can answer 429. SubscribeToPushNotifications returns false and PropagateAuthState returns. lastPropagatedUser stays anonymous; finally clears propagatingUser.
  3. The user signs out before any other authentication state change. The new state is IAuthTokenProvider.Anonymous(), and user.IsTheSame(propagatingUser ?? lastPropagatedUser) compares two anonymous principals with no claims, which IsTheSame reports as the same. PropagateAuthState returns before doing anything.

Result after the sign-out:

  • the SignalR connection is never told (ChangeAuthenticationState isn't invoked), so on the server it stays the signed-out user's connection and can keep receiving messages meant for that user;
  • TelemetryContext.UserId / UserSessionId (and App Insights' authenticated user context) keep the signed-out user;
  • the push subscription isn't re-subscribed for the anonymous state.
Expected behavior

A sign-out always propagates, even when the sign-in before it stopped early on a 429.

Suggested fix

Forget the last propagated user when stopping early, so the next state propagates whatever it compares to. This keeps the intended retry (the same signed-in user propagates again on the next state change):

if (await pushSubscription is false)
{
    lastPropagatedUser = null;
    return;
}
Version

Bit.Boilerplate 10.7.0; the same code is on develop today.

Lenguaje dominante
C#
Estrellas
1.4k
Forks
264
Merge medio
10 h 31 min
PR fusionados (30 d)
405

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bitfoundation/bitplatform

Todos los issues de bitfoundation/bitplatform

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.