fix(android): keep Tor bootstrap alive after the unlock activity dies #116
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/android-bootstrap-survives-ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Unlock showed the Publishing onion spinner, then the activity died and the lock screen came back idle. Tor never finished.
Cause:
openWireran onviewModelScope, and the keep-alive service refused to start untilNodeHost.current()was set (only after publish). Closing the activity cancelled bootstrap. There was no FGS yet, so Android could also kill the process.Fix
openWireon NodeHost's process-wide IO scope so a ViewModel cancel does not abort Tor.keepAliveHasWork(nodeOpen, bootstrapInFlight)- in-flight bootstrap counts as work.noteOpeningfirst so the service does not stopSelf in the gap).awaitOpen().Tests
KeepAlivePolicyTest- bootstrap-in-flight is work; locked+idle is not.UnlockSubmitTest- empty passphrase does not submit; remember flag is preserved.:app:testDebugUnitTestwas not run here because it rebuilds the cuprate-daemon NDK graph. Policy tests are pure JVM.Device check
After Open: persistent notification OnionWire is starting, spinner survives leaving the activity. First publish still takes minutes. Lock still cancels bootstrap.