Sign-in: keep the app answering the browser while it waits (bugfix) #572
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 507 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.373
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #572"
general
weight: 0.35
Giton22
Fixes #555
What and why
Sign in with browser comes back through a listener on 127.0.0.1 inside the app. On Android, once the sign-in page covers Kyllene, the app drops to the cached state. Two things then stop the listener from answering:
The gateway logs the code as issued, but
POST /auth/native/tokennever arrives. Every Hermes tag from v0.22.0 to v0.23.4 accepts only anhttp://127.0.0.1or[::1]redirect, so a custom-scheme or App Link redirect isn't possible.This change:
SignInService, a special-use foreground service with a quiet "Finishing sign-in…" notification.-
BrowserSignInholds it from just before the browser opens, while Kyllene is still in front, until the sign-in ends: success, a turned-down code, the 10-minute timeout, Cancel, or switching gateway (in afinally).- It is
START_NOT_STICKYandstopWithTask, and it stops itself after 11 minutes at most. If the process dies, it goes with it.- Why special use:
shortServiceis cut off after 3 minutes, less than a sign-in with a second factor can take.- The waiting screen shows a warning line instead, with a Battery settings button that opens the app's info page. Android has no public link to the battery page itself.
- The check runs again whenever Kyllene comes back in sight. A sign-in still waiting gets held up once the restriction is lifted.
SignInKeepAliveinterface inshared:core. It does nothing on desktop and in tests.values-*folder. The ROADMAP item for browser sign-in now has a note.Gateway versions: the change is client-side only. It changes no gateway call or route, so it behaves the same with Hermes v0.22.0 to v0.23.4, in legacy and session-authority modes. I didn't run the gateway matrix.
Tests
BrowserSignInTest(MockEngine for/auth/native/token). These tests fail without the fix:- the app is held from before the browser opens until the code is redeemed;
- it is let go on a turned-down code (400), on the timeout and on cancel;
- nothing is held when the listener can't start;
- a refused hold still signs in.
SignInViewModelTest:- the hold covers only the wait, and Cancel and switching gateway let go;
- the restricted hint follows the setting.
PreviewScene.SignInRestricted, at 360 dp.- Passed: the CI command, plus
:desktopApp:compileKotlinJvm.-
:shared:ui:jvmTest:DesktopPdfTestfailed two tests locally (closeDuringReplacementStartupCannotPublishALiveWorker,renderDeadlineAndExplicitCloseUnblockPipeReads). This change doesn't touch that code, and that task isn't in CI's command.aCancelledSignInLettingGoLateKeepsTheNextOneHeld: it failed before d5ecf7e9 and passes now.- I waited 30 minutes, but no emulator slot was free. Slot 0 was taken, and slots 1 and 2 can't boot while slot 0 runs without
-read-only.- I reproduced the bug on an Android 17 emulator against a fake OIDC gateway, but not on this branch.
- Still to check on a device, with a ~90 s identity-provider delay:
- Optimized and Unrestricted: no
am_freeze, and the token POST arrives.- Restricted: the hint shows, and the button opens App info.
- The notification appears and goes away when the sign-in ends.