From 2891a170db25f4b508162698feea147e45cd528b Mon Sep 17 00:00:00 2001 From: Seb3thehacker Date: Tue, 13 Oct 2026 16:17:49 -0700 Subject: [PATCH] usage notes: say which boxes are ticked, so the server can drop details from unticked ones --- .../app/seb3thehacker/gearslip/stats/UsageStats.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/stats/UsageStats.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/stats/UsageStats.kt index 8c2c507..4c4855e 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/stats/UsageStats.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/stats/UsageStats.kt @@ -88,6 +88,9 @@ object UsageStats { .putBoolean("share_phone", choices.phone) .putBoolean("share_cars", choices.cars) .putBoolean("share_failures", choices.failures) + // The server drops details from a box once it's unticked, so the next note sends + // them again rather than assuming the server still has them. + .remove(KEY_SENT_DETAILS) .apply() // Turning it on sends nothing yet: the driver may still be ticking boxes. The first note // waits for [choicesClosed]. @@ -251,6 +254,14 @@ object UsageStats { .put("version", BuildConfig.VERSION_NAME) .put("code", BuildConfig.VERSION_CODE) .put("build", if (BuildConfig.DEBUG) "dev" else "release") + // Which boxes are ticked, so the server knows what this phone shares and can drop + // anything it kept from a box since unticked. + .put("shares", JSONArray().apply { + if (c.android) put("android") + if (c.phone) put("phone") + if (c.cars) put("cars") + if (c.failures) put("sessions") + }) // Phone details change rarely, so they ride along only when they differ from what the // server last got, or once a month in case it lost them. Unticked ones are left out, and // the server keeps the last value it had.