Skip to content

[WIP] Fix notification scheduling logic for daily reminders#97

Merged
GitTimeraider merged 1 commit intodevelopfrom
copilot/fix-notification-scheduling-logic
Apr 2, 2026
Merged

[WIP] Fix notification scheduling logic for daily reminders#97
GitTimeraider merged 1 commit intodevelopfrom
copilot/fix-notification-scheduling-logic

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt

Fix notification scheduling logic so users receive daily reminders for subscriptions that are within their configured notification window (X days before expiration).

Repository: GitTimeraider/Subscription-Tracker-docker
Base branch: develop

Observed bug:

  • User reports that when a subscription is within X days before expiration, the system does not send an email every day as expected.

What to investigate and fix:

  1. Inspect app/email.py, especially check_expiring_subscriptions and its interaction with:
    • UserSettings.last_notification_sent
    • user timezone handling
    • preferred notification hour matching
    • expiring subscription filtering (end_date <= today + notification_days and end_date >= today)
  2. Ensure the logic supports true once-per-day reminders (not one-time-only within the window).
  3. Ensure reminders are sent daily while subscription remains in window, until expiry date passes.
  4. Preserve duplicate-protection within a single day.
  5. Ensure behavior remains correct with timezone-aware scheduling and hourly scheduler checks.
  6. Confirm no regression for users with email/webhook toggles.

Likely area to correct:

  • Distinguish daily dedupe (last_notification_sent by date) from per-subscription reminder suppression state (Subscription.last_notification). If per-subscription state is used in filtering or sending path in a way that suppresses subsequent daily reminders, update that logic so reminders can repeat each day during active window.

Validation expectations:

  • For a subscription with end_date in 5 days and notification_days=7: notification is sent today and again tomorrow (and each day through expiry window, at most once per user per day).
  • For same day reruns of scheduler: no duplicate send after first successful send that day.
  • If send fails for all enabled methods, daily flag should not block retry.

Please implement the code changes and open a PR from a new branch targeting develop with a clear title and description of root cause and fix.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: In the develop branch of my subscription tracker. When an subscription is within the set X days before expiration. It should send an email every day informing the user about it. Right now that does not happen.

Assistant: Got it — this sounds like a bug in the reminder scheduling logic on develop in GitTimeraider/Subscription-Tracker-docker: it likely sends once (or not at daily cadence) instead of sending every day during the “within X days before expiration” window.

If you want, I can fix this by opening a PR, but I need you to explicitly request PR creation (e.g., “Create a PR to fix it in GitTimeraider/Subscription-Tracker-docker on develop”).

If you’d rather debug first, I can investigate the exact root cause by tracing:

  1. where expiration-window eligibility is computed,
  2. where “last email sent” / dedupe logic is stored, and
  3. how the daily job/cron task is triggered on Docker deploy.

User: Find the issue and then Create a PR to fix it in GitTimeraider/Subscription-Tracker-docker on develop.

Assistant: I’m waiting on your approval in the GitHub confirmation dialog—once you accept it, I can continue and create the fix PR against develop.

This pull request was created from Copilot chat.

@GitTimeraider GitTimeraider marked this pull request as ready for review April 2, 2026 20:31
Copilot AI review requested due to automatic review settings April 2, 2026 20:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GitTimeraider GitTimeraider merged commit 89da160 into develop Apr 2, 2026
3 of 4 checks passed
Copilot stopped work on behalf of GitTimeraider due to an error April 2, 2026 20:32
Copilot AI requested a review from GitTimeraider April 2, 2026 20:32
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