Skip to content

Aura v6.15.0 — Deep audit pass

Choose a tag to compare

@SysAdminDoc SysAdminDoc released this 13 May 14:29
· 587 commits to main since this release

Deep audit pass — 11 real bugs found in the v6.13–v6.14 deltas (AI wallpaper generation, Phase 6.2 dark/light auto-switch, Phase 6.4 adaptive tint, Phase 2.5 seasonal/Pexels). All fixes ship with unit-test regression nets. 248/248 unit tests green.

Data integrity (P0)

  • WeatherUpdateWorker was storing latitude/longitude with putLong(value.toLong()) — silently truncating fractional degrees. A user at 39.7392° was stored as 39, a user near the equator at 0.5° was stored as 0. The reader then used the tintLat != 0.0 && tintLon != 0.0 sentinel to gate adaptive tinting, so anyone within 1° of Null Island had tinting disabled entirely. Switched to putFloat (~7 sig figs, sub-meter precision) plus a location_present boolean sentinel. Reader falls back to the legacy Long keys for a single update cycle so existing installs don't lose tinting between upgrade and the next 30-min worker tick.

Correctness (P1)

  • SolarCalculator.sunTimes default UTC-offset arg used TimeZone.getDefault().rawOffset which ignores DST. Every region observing daylight saving had sunrise/sunset shifted by an hour for ~half the year, which the adaptive-tint phase math depends on. Switched to getOffset(System.currentTimeMillis()).

Battery + correctness (P1)

  • SystemThemeListener (Phase 6.2 new code) ran a 500 ms while (true) polling loop that never stopped when the user disabled auto-switch and trapped the outer flow-collector. Replaced with ComponentCallbacks.onConfigurationChanged — an actual event, delivered even while the app is fully backgrounded.

Reliability (P1)

  • SystemThemeListener.applyStoredWallpaper called WallpaperApplier.applyFromUrl, which only speaks HTTP — OkHttp.Request.Builder().url(...) throws IllegalArgumentException for file:// or content:// schemes. Users whose last applied wallpaper was AI-generated (file:/data/.../foo.png) silently lost auto-switch. New WallpaperApplier.applyByLocator dispatches on scheme: http(s) → OkHttp path, file/content/absolute-path → bounded two-pass BitmapFactory decode with inSampleSize sampling.

Storage leak (P1)

  • AiWallpaperRepository.pruneOldFiles was defined but never called — the 50-image cap was a promise, not enforcement. Now invoked after every successful generation. Also sweeps stale .tmp files left by interrupted writes.

Thread safety + responsiveness (P1)

  • AiWallpaperViewModel.applyWallpaper decoded the full-resolution PNG via BitmapFactory.decodeFile on the Main coroutine context. Re-routed through applyByLocator so the disk read + decode + sampling all happen on Dispatchers.IO.

Structured concurrency (P2)

  • AiWallpaperRepository.generate wrapped the body in runCatching which captures CancellationException. A back-navigation mid-generation was surfaced as a generic error message instead of a clean coroutine teardown. Switched to explicit try/catch with cancellation rethrow.

Performance (P2)

  • WeatherWallpaperService.draw allocated a new ColorMatrix + Paint every frame at 30 FPS whenever adaptive tint was enabled (~30 allocations/sec under steady-state). Cached the Paint by 5-minute time bucket; also short-circuits to the no-tint draw path during the neutral-midday window.

UX (P2)

  • Settings dark/light mode wallpaper slot opened an AlertDialog only when wallpaper history was non-empty — a fresh install / cleared history made the slot affordance a dead click. Now opens regardless and shows a "No wallpapers applied yet" explanatory empty state with guidance. VFX picker confirm button relabeled "Cancel" → "Close" since each radio click commits synchronously.

Error messages (P2)

  • AiWallpaperRepository now maps Stability AI HTTP codes (401/402/403/422/429/5xx) to actionable user copy ("API key invalid", "Out of credits", "Content policy", "Rate limited") instead of "Generation failed (HTTP 429): {raw JSON}".

Tests

  • 30 new unit tests across SolarCalculatorTest, AiWallpaperRepositoryFriendlyErrorTest, WallpaperLocatorSchemeTest. Fixed pre-existing SettingsViewModelTest fixture gap. 248/248 unit tests green.