Repository navigation
No crash when the app is opened right after an update (2.30.1) - #309
Conversation
A service asked for with startForegroundService must not be stopped before startForeground: WebService.stop leaves a pending one, which stops itself in onStartCommand when the app is open. No trailing comma under Exit without a git hash. e2e opens the app right after an update, five times. Closes #308
PR Summary by QodoPrevent a foreground-service crash when opening the app after an update
AI Description
Merge Risk
|
Code Review by Qodo
1.
|
|
Qodo's finding is right, fixed in 1500397: each of the five updates must report |
Closes #308.
WebService.stopleaves a service whose start is still pending (stopping it beforestartForegroundends the app);onStartCommandcallsstartForegroundand then stops itself when the app is open or opening, as it did with remote access off.GIT_HASHis empty in a container that cannot see the repository).VersionLineTest.tests/e2e.sh: an update and an open in one device shell, five times: no crash, the service gone afterwards.Checks (local, Docker): unit tests, lint (13 warnings as before),
check-version.sh. The new e2e check on the old code, API 34: 2 of 5 starts hit the race and both crashed. With the fix: UDP API 21 and 34 20/20, TCP API 21 and 34 21/21. On API 34 the race came up once in each run; whether it does depends on timing. On API 21 there are no foreground service starts, so it only checks that the service goes away.