v1.19: fix empty usage-history chart (always fetch utilization)
Build APK / build (push) Successful in 1m52s

recordHistory() only ever stored fiveHourUtilization/weeklyUtilization, but
fetchUsage() returned early with message-count data — before calling the
/usage utilization endpoint — whenever the org JSON carried a message limit.
So utilization was never populated and the history chart stayed stuck on
'Collecting history…'. The prior chart fix only corrected the throttle.

- UsageRepository: always attempt /usage (preferred signal that drives the
  weekly bar + history); fall back to org message-count data only when
  utilization is unavailable.
- UsageData.sessionReadingPct: utilization preferred, message-count % fallback,
  -1f when no reading — so message-only accounts also build history.
- PreferencesManager.recordHistory: record the session line from
  sessionReadingPct instead of utilization-only.
- UsageDataTest: cover sessionReadingPct.
This commit is contained in:
2026-06-12 01:48:04 +00:00
parent 31e18ed5e9
commit 58e3a0fcd7
5 changed files with 67 additions and 15 deletions
+2 -2
View File
@@ -24,8 +24,8 @@ android {
applicationId = "me.khodak.claudeusage"
minSdk = 26
targetSdk = 34
versionCode = 19
versionName = "1.18"
versionCode = 20
versionName = "1.19"
}
val releaseStorePassword = signingCred("KEYSTORE_PASSWORD", "storePassword")