kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Android: white screen on relaunch after signing out

Open rtibblesbot opened this issue 3 months ago • 1 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Target branch: develop

Observed behavior

Signing out and force-closing the Android app leaves it on a white screen on the next launch, and it stays white across further relaunches.

The server is healthy underneath. GET /en/device/ returns 200, the core bootstrap calls that follow all return 200, and then no request from the Device plugin ever arrives — a render-side failure, not a server one. logcat shows no crash, ANR or WebView renderer death.

Reported by @pcenov on #15207 with the repro steps and artifacts below, after @radinamatic hit the same white /en/device/ during QA of that PR. #15207's diff is five files under kolibri/plugins/user_auth/frontend/ and is not involved: the repro build is release 0.19.4.

Errors and logs

The launch that goes white — server serves the page, core boots, Device plugin never fires (logs/kolibri.txt, trimmed):

19:25:15,333 "GET /api/device/initialize/a8d1ab10d597469d8b7fdb9a4db3609c" 302 0
19:25:15,648 "GET /en/device/" 200 0
19:25:17,408 "PUT /api/auth/session/current/" 200 0 ".../en/device/"
19:25:17,595 "GET /api/notifications/pingbacknotification/" 200 0
19:25:17,634 "GET /api/auth/facility/" 200 0
19:25:17,660 "GET /api/auth/facilitydataset/" 200 0

Sign-out sets the restored path to /en/auth/ (WebViewLocation.save), which the app-key re-login then redirects past on the next launch:

19:24:11,000 "GET /en/logout/"       302 0 ".../en/device/"
19:24:11,036 "GET /en/redirectuser/" 302 0 ".../en/device/"
19:24:11,188 "GET /en/auth/"         200 0 ".../en/device/"
19:24:26,900 "GET /en/auth/"         302 0
19:24:27,211 "GET /en/device/"       200 0     <- white

The redirect chain is not required: the launch at 19:25:15 restores /en/device/ directly and is white too.

logcat and logs-db.zip are attached to the reports: https://github.com/user-attachments/files/31561651/android-logs.zip and https://github.com/user-attachments/files/31495885/logcat.txt

Expected behavior

The Device page renders after relaunching, as it does before the sign-out.

User-facing consequences

The app is unusable after any sign-out. It does not recover from a force-close or a device reboot, so the only route back is clearing app data, which loses the device's Kolibri home.

Steps to reproduce

  1. Launch the Android app.
  2. Go through the Setup Wizard: Group learning > Full device > Create a new learning facility > Non-formal facility.
  3. At Device > Channels, open the menu and select Sign out.
  4. Force close the app.
  5. Launch the app again — white screen.

Setup Wizard > On my own does not reproduce it.

Context

  • Kolibri 0.19.4 Android (Chaquopy), a release APK — not a build of #15207.
  • Samsung SM-N770F, Android 13, System WebView Chrome 151.
  • The Chaquopy WebView layer this exercises came from learningequality/kolibri-installer-android#259 and now lives at platforms/android; that repo is archived, so this is filed here.
  • The white page is /en/device/ because RootURLRedirectView routes a superuser there on every launch; the "even after a reboot" persistence is that redirect, not stored state.
  • Neither reproduction captured the WebView console. adb logcat chromium:I *:S during a repro would name the JS exception.

Acceptance Criteria

  • [ ] Signing out, force-closing and relaunching renders the Device page instead of a white screen.
  • [ ] Setup Wizard > On my own followed by a relaunch still works.
  • [ ] A regression test at the platforms/android layer covers relaunch after sign-out.

AI usage

This issue was written by @rtibblesbot, an LLM agent, while working #15067 / #15207. The repro steps are @pcenov's, quoted from their comment; @radinamatic supplied the first artifacts. I verified the parts I assert here against the attached logs myself: the 0.19.4 version string, the access-log sequences quoted above, and that the 19:25:15 launch is white without a redirect chain. I did not reproduce it on a device, and it names no root cause.

rtibblesbot avatar Aug 28 '26 16:08 rtibblesbot

Plan: Relaunching the Android app after a sign-out renders the Device page instead of a white screen.

  • [ ] Capture the baseline on a device
  • [ ] Split the saved location's fragment from its path
  • [ ] Restore the fragment locally instead of through the server
  • [ ] Give the Device plugin a catch-all route
  • [ ] Verify both acceptance paths on the emulator
  • [ ] Self-review the produced code

Assumptions — the issue did not settle these; say so if one is wrong.

  • Fix goes in the Android layer, not in Django emitting Location: <url># to break inheritance globally — if wrong, every other client that replays a saved URL through next= keeps the bug.
  • pendingRestoreLocation is consumed by the first onPageFinished after the initialize load — if a WebView build fires that for an intermediate redirect document, the restore is spent early and the page renders at its default route instead of the saved one.
  • The restore overwrites a fragment the landed page's own router already set — if the resulting hashchange is visible rather than hidden under the splash, users see one frame of the wrong page.
  • AC 3's "regression test at the platforms/android layer" means the Robolectric tests — Robolectric cannot model browser fragment inheritance, so what they pin is that no fragment ever enters next, not the white screen itself.
  • The Device catch-all (Task 4) is in scope as the second layer — if reviewers call it unrelated, dropping that commit still leaves AC 1 met by Tasks 2-3.
  • The emulator, SDK and tar staging are available for Tasks 1 and 5 — if not, AC 1 and AC 2 rest on code reading plus unit tests, and the PR must say so.
  • Coach, facility and setup_wizard are left without catch-alls — if a reviewer wants the class closed everywhere, that is a separate change across three more plugins.

Open questions

  • None.

@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
  • Ran the project's full test suite and linter before committing
  • For UI changes: captured live screenshots to verify rendering
  • For backend changes: verified with example API/CLI output

rtibblesbot avatar Sep 18 '26 21:09 rtibblesbot