diff --git a/android/src/main/java/com/timesafari/dailynotification/DailyNotificationWorker.java b/android/src/main/java/com/timesafari/dailynotification/DailyNotificationWorker.java index 18f19ae..ad9ba07 100644 --- a/android/src/main/java/com/timesafari/dailynotification/DailyNotificationWorker.java +++ b/android/src/main/java/com/timesafari/dailynotification/DailyNotificationWorker.java @@ -161,24 +161,24 @@ public class DailyNotificationWorker extends Worker { Log.d(TAG, "DN|DISPLAY_STATIC_REMINDER id=" + notificationId + " title=" + title); } else { // Regular notification: load from storage - // Prefer Room storage; fallback to legacy SharedPreferences storage + // Prefer Room storage; fallback to legacy SharedPreferences storage content = getContentFromRoomOrLegacy(notificationId); - - if (content == null) { - // Content not found - likely removed during deduplication or cleanup - // Return success instead of failure to prevent retries for intentionally removed notifications - Log.w(TAG, "DN|DISPLAY_SKIP content_not_found id=" + notificationId + " (likely removed during deduplication)"); - return Result.success(); // Success prevents retry loops for removed notifications - } - - // Check if notification is ready to display - if (!content.isReadyToDisplay()) { - Log.d(TAG, "DN|DISPLAY_SKIP not_ready id=" + notificationId); - return Result.success(); - } - + + if (content == null) { + // Content not found - likely removed during deduplication or cleanup + // Return success instead of failure to prevent retries for intentionally removed notifications + Log.w(TAG, "DN|DISPLAY_SKIP content_not_found id=" + notificationId + " (likely removed during deduplication)"); + return Result.success(); // Success prevents retry loops for removed notifications + } + + // Check if notification is ready to display + if (!content.isReadyToDisplay()) { + Log.d(TAG, "DN|DISPLAY_SKIP not_ready id=" + notificationId); + return Result.success(); + } + // JIT Freshness Re-check (Soft TTL) - skip for static reminders - content = performJITFreshnessCheck(content); + content = performJITFreshnessCheck(content); } // Display the notification diff --git a/test-apps/android-test-app/app/src/main/AndroidManifest.xml b/test-apps/android-test-app/app/src/main/AndroidManifest.xml index 99045d2..df04067 100644 --- a/test-apps/android-test-app/app/src/main/AndroidManifest.xml +++ b/test-apps/android-test-app/app/src/main/AndroidManifest.xml @@ -34,7 +34,7 @@ - +