Skip to content

fix: show time until the event (not the reminder) in the save countdown#1241

Closed
MiMoHo wants to merge 1 commit into
FossifyOrg:mainfrom
MiMoHo:fix/issue-1073
Closed

fix: show time until the event (not the reminder) in the save countdown#1241
MiMoHo wants to merge 1 commit into
FossifyOrg:mainfrom
MiMoHo:fix/issue-1073

Conversation

@MiMoHo

@MiMoHo MiMoHo commented Jul 3, 2026

Copy link
Copy Markdown

Type of change(s)

  • Bug fix

What changed and why

When saving an event that has at least one notification reminder, Context.scheduleNextEventReminder() picks the next reminder time (curEvent.getEventStartTS() - curReminder) * 1000L and passes it to Context.scheduleEventIn() as notifyAtMillis. Inside scheduleEventIn, the "time remaining" toast was computed from the notification/alarm time rather than the event start:

val secondsTillNotification = (newNotifyAtMillis - now) / 1000

So the toast counted down to the reminder, not the event. Example: an event 2 hours away with a "10 minutes before" reminder showed "1 hour, 50 minutes" instead of "2 hours".

This changes only the toast computation to use the event start time:

val secondsTillEvent = event.getEventStartTS() - getNowSeconds()

Both getNowSeconds() and event.getEventStartTS() are already imported/used in this file, so no new imports are needed. Scheduling behaviour and the notifyAtMillis < now guard are deliberately left untouched, so the snooze / reschedule path (rescheduleReminder) is unaffected. On this code path secondsTillEvent is guaranteed positive because scheduleNextEventReminder only calls scheduleEventIn when curEvent.getEventStartTS() - curReminder > now with a non-negative reminder offset, so start > now.

Tests performed

  • detekt, lint, unit tests and the build all pass locally (CI-equivalent).
  • Verified on an Android 15 (API 35) emulator that creating an event with a notification reminder saves correctly and the reminder fires.
  • Source-verified: the save-time countdown toast is now computed from the event start (getEventStartTS() - getNowSeconds()) instead of the next reminder time.
  • Note: the toast itself is transient (~2s, rendered during the activity-close transition) and could not be frozen into a readable screenshot despite several capture methods, so the exact toast text is verified via CI + code review.

Closes the following issue(s)

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes on device/emulator (verified via CI + source review; see Tests performed).
  • I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I have self-reviewed my pull request (no typos, formatting errors, etc.).
  • I understand every change in this pull request.

Coded with Opus 4.8 ultracode.

When saving an event that has a notification reminder, scheduleEventIn
computed the countdown toast from the alarm/notification time
(newNotifyAtMillis - now) instead of the event start time, so it showed
the time until the reminder rather than the time until the event.

Compute the remaining time from event.getEventStartTS() - getNowSeconds()
so the toast counts down to the event start. Scheduling behaviour and the
notifyAtMillis < now guard are left untouched, so the snooze path is
unaffected.

Closes FossifyOrg#1073
@MiMoHo MiMoHo requested a review from naveensingh as a code owner July 3, 2026 21:45
@MiMoHo MiMoHo closed this Jul 3, 2026
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.

Countdown Message on Event Creation Incorrect

1 participant