Widget shows 0 h 0 m when the category query fails, overwriting good totals
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Empieza con widget/CategoryTimeWidgetUpdater.kt, especialmente con parseCategories en las líneas 420–447, y compara su tratamiento con parseEventsJSON y parseBucketsJSON. Ejecuta la prueba fallida queryErrorObjectIsAFailureNotZeroMinutes en CategoryTimeWidgetUpdaterTest; el trabajo estará hecho cuando el objeto de error se propague como un fallo mientras que un array realmente vacío siga representando que no hay categorías, lo que permite que onUpdateFailed conserve los totales mostrados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
When the native query fails, the home-screen widget shows 0 h 0 m for today and replaces totals that were already rendered.
androidQuery returns {"error": "Something went wrong when trying to query: …"} when the query fails (aw-server-rust aw-server/src/android/mod.rs, create_error_object). This happens, for example, when the aw-watcher-android bucket has been deleted, when a category regex doesn't compile, or when the datastore errors. CategoryTimeWidgetUpdater.parseCategories (widget/CategoryTimeWidgetUpdater.kt:420-447) passes that string to JSONArray(...), which throws. The exception is caught and the function returns the same empty list as a genuine "[]". loadData therefore counts as a success, and the widget renders zero minutes with a fresh timestamp. The KDoc of onUpdateFailed says a load failure renders "no data yet" and keeps the data already shown; that path is never reached.
Failing test (CategoryTimeWidgetUpdaterTest):
@Test
fun queryErrorObjectIsAFailureNotZeroMinutes() {
// what androidQuery returns when the query fails
val error = """{"error":"Something went wrong when trying to query: x"}"""
assertThrows(Exception::class.java) { CategoryTimeWidgetUpdater.parseCategories(error) }
}
It fails today because parseCategories returns emptyList(), the same result as for "[]".
Fix direction: recognise the error object (as parseEventsJSON / parseBucketsJSON already do for getEvents / getBuckets) and let it propagate, so onUpdateFailed runs.
NotifyWorker has the same parse pattern with a different symptom; filed separately as #431.
Priority: medium (users see wrong totals). This repo only has a priority: high label, so no priority label is set.
fingerprint: widget/CategoryTimeWidgetUpdater.kt — androidQuery error object rendered as 0 minutes
Found by code review on master 3b820d61. I verified the trigger path against aw-server-rust 67432e66. I have not run it on a device.
- Lenguaje dominante
- Kotlin
- Estrellas
- 291
- Forks
- 73
- Merge medio
- 4 d 5 h
- PR fusionados (30 d)
- 27
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ActivityWatch/aw-android
-
WebWatcher: keyboard events still split visits in detected browsers (browserIsActiveWindow checks only the hard-coded list)Posiblemente ocupada @TimeToBuildBob la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ActivityWatch/aw-android#435 ·
Los mantenedores suelen responder en 2 días
-
Widget ignores short hex category colors (#CCC), so Uncategorized gets a fallback colorPosiblemente ocupada @TimeToBuildBob la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ActivityWatch/aw-android#433 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
ActivityWatch/aw-android#431 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ActivityWatch/aw-android#383 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
Web watcher: add support for Brave (`com.brave.browser` missing from KNOWN_BROWSER_PACKAGES)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ActivityWatch/aw-android#306 · 1 comentario · 2 reacciones ·
Los mantenedores suelen responder en 2 días
Todos los issues de ActivityWatch/aw-android
Issues similares
-
Area: Java bug report needs triage OS: Windows
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
actions/runner-images#15458 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nwverse/persona#22164 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
(core): a cluster client ignores insecure TLS when a CA certificate or client identity is setAbiertobug 🐞
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
valkey-io/valkey-glide#8000 ·
Los mantenedores suelen responder en 2 días
-
Declare two limitations the 2026-12-02/03 plausibility runs confirmed: Huxleys ticket link, Gretchen flyerPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoafk-ok area:data-quality importer size:S
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
enorm-labs/event-junkie#5887 ·
Los mantenedores suelen responder en 1 día