rouse-context/work
Jason Monk 68be0f457a
Fix #289: Force-immediate cert renewal check on app start (#294)
Before this change, `RouseApplication.onCreate` only scheduled the 24h
periodic `CertRenewalWorker`. A user who opens the app with an already-
expired cert would sit stuck for up to 24h before the first periodic
tick. The tunnel's mTLS handshake fails on an expired cert, so there
was no in-band recovery path.

Add `CertRenewalScheduler.enqueueImmediateIfExpiring` which reads the
stored cert's expiry, compares it to a configurable threshold (default:
the worker's own 21-day renewal window), and enqueues a one-time
`CertRenewalWorker` under a dedicated unique-work slot
(`cert_renewal_immediate`) when the cert is near-or-past expiry.
`ExistingWorkPolicy.KEEP` avoids resetting run attempts on repeated app
restarts.

Wire this into `RouseApplication.onCreate` after the existing
`enqueuePeriodic` call. The new unique-work slot is distinct from the
periodic slot so the 24h schedule is preserved as the long-running
safety net.

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
2026-04-19 16:11:25 -04:00
..
src Fix #289: Force-immediate cert renewal check on app start (#294) 2026-04-19 16:11:25 -04:00
build.gradle.kts Fix #233: Wire up Firebase Crashlytics for release builds (#261) 2026-04-18 21:46:22 -04:00