Skip to content

fix(notify): accept canonical shared config schema - #246

Merged
ErikBjare merged 1 commit into
ActivityWatch:masterfrom
TimeToBuildBob:fix/notify-canonical-config-schema
Sep 10, 2026
Merged

fix(notify): accept canonical shared config schema#246
ErikBjare merged 1 commit into
ActivityWatch:masterfrom
TimeToBuildBob:fix/notify-canonical-config-schema

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Contributor

Summary

This closes the Android parser slice of #201. Desktop consumption remains in ActivityWatch/aw-notify-rs#39.

Test plan

  • reproduced canonical object input falling back to defaults before the change
  • JAVA_HOME=/opt/android-studio/jbr ANDROID_HOME=/home/bob/Android/Sdk ./gradlew :mobile:testDebugUnitTest --no-daemon --console=plain
  • canonical, aggregate-All, empty, malformed, invalid-threshold, and legacy inputs covered by unit tests

@greptile-apps

greptile-apps Bot commented Aug 30, 2026

Copy link
Copy Markdown

Greptile Summary

The PR extends Android’s notification-setting parser to consume the canonical object and snake_case schema while retaining legacy array compatibility.

  • Maps canonical All alerts to aggregate activity.
  • Supplies useful defaults for nullable or empty labels.
  • Validates positive integral thresholds and skips malformed alert objects.
  • Preserves an explicitly empty canonical alert list.
  • Adds unit coverage for canonical, legacy, empty, malformed, and invalid-threshold inputs.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The canonical parser matches the documented setting shape, preserves intentional empty and fallback behavior, and retains compatibility with the legacy representation.

Important Files Changed

Filename Overview
mobile/src/main/java/net/activitywatch/android/workers/NotifyWorker.kt Adds canonical alert configuration parsing, validation, fallback behavior, and legacy compatibility without an established actionable defect.
mobile/src/test/java/net/activitywatch/android/workers/NotifyWorkerTest.kt Adds focused tests covering the new schema, aggregate mapping, empty configuration, malformed entries, threshold validation, and legacy parsing.

Reviews (1): Last reviewed commit: "fix(notify): accept canonical shared con..." | Re-trigger Greptile

@TimeToBuildBob

TimeToBuildBob commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click.

This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge. Project monitoring marked it human_merge_required and will not spend retry sessions attempting an automated merge. A new head will be evaluated independently.

Automated merge handoff for 787c36323cb1:

  • CI gate: satisfied
  • Review threads: clear
  • Self-merge policy: human review required for these path/category-policy blockers:
  • mobile/src/main/java/net/activitywatch/android/workers/NotifyWorker.kt
  • mobile/src/test/java/net/activitywatch/android/workers/NotifyWorkerTest.kt

@ErikBjare
ErikBjare merged commit b908428 into ActivityWatch:master Sep 10, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants