Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#14,428 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp, wasm

Direzione di ricerca

Inizia da AppClientCoordinator.PropagateAuthState nel modello Boilerplate e segui come viene aggiornato lastPropagatedUser quando la sottoscrizione push restituisce 429. Controlla i test di propagazione dello stato di autenticazione, se presenti, e aggiungi una verifica per la disconnessione dopo questa restituzione anticipata. Il lavoro è completato quando la disconnessione aggiorna lo stato di autenticazione SignalR e la telemetria utente, e la sottoscrizione push viene ritentata per lo stato anonimo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C#
Stelle
1.4k
Fork
264
Merge medio
10h 48m
PR unite (30g)
425

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bitfoundation/bitplatform

Tutte le issue di bitfoundation/bitplatform

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.