Skip to content

Fix repeated update notifications after dismiss#127

Merged
anod merged 1 commit into
masterfrom
fix-repeated-update-notifications
May 29, 2026
Merged

Fix repeated update notifications after dismiss#127
anod merged 1 commit into
masterfrom
fix-repeated-update-notifications

Conversation

@anod

@anod anod commented May 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • mark update notifications viewed when the Dismiss action is used
  • add a delete intent so swiping a notification away also marks updates viewed
  • add a regression test for notification action read-state mapping

Validation

  • .\gradlew.bat :app:testDebugUnitTest
  • .\gradlew.bat :app:ktlintMainSourceSetCheck :app:ktlintTestSourceSetCheck

Note: full .\gradlew.bat ktlintCheck is blocked by a pre-existing final-newline violation in app\build.gradle.kts.

Mark update notifications as viewed when users dismiss them from the notification action or swipe them away so already-seen updates are not surfaced again.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 29, 2026 11:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a bug where update notifications kept reappearing after the user dismissed them. Dismissal (via the action button or by swiping the notification away) now marks updates as viewed, matching the behavior already triggered when the watchlist is opened.

Changes:

  • NotificationActivity now centralizes notification-action constants at top level and uses a shouldMarkUpdatesViewed() helper so the dismiss action also flips prefs.isLastUpdatesViewed = true.
  • SyncNotification adds a setDeleteIntent(...) routing swipe-aways through NotificationActivity with ACTION_DISMISS, and consolidates pending-intent creation via a small markViewedPendingIntent helper.
  • New unit test NotificationActivityTest covers the action-type → mark-viewed mapping.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
app/src/main/java/com/anod/appwatcher/NotificationActivity.kt Adds top-level action constants and shouldMarkUpdatesViewed; dismiss now marks updates viewed.
app/src/main/java/com/anod/appwatcher/sync/SyncNotification.kt Adds delete intent for swipe-dismiss and consolidates pending intent creation.
app/src/test/java/com/anod/appwatcher/NotificationActivityTest.kt New unit test for action-type to mark-viewed mapping.

@anod
anod merged commit e2effa9 into master May 29, 2026
4 checks passed
@anod
anod deleted the fix-repeated-update-notifications branch May 29, 2026 13:02
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.

3 participants