Fix talk reminders firing 2h late by using device timezone#1
Closed
GerardPaligot wants to merge 1 commit into
Closed
Fix talk reminders firing 2h late by using device timezone#1GerardPaligot wants to merge 1 commit into
GerardPaligot wants to merge 1 commit into
Conversation
Schedule start times come from the backend as event-local wall-clock LocalDateTime strings without an offset (e.g. "2026-06-11T08:30" for a session in Lille). The Android alarm scheduler re-interpreted them as UTC, so for a Europe/Paris event the reminder fired CEST's +2h offset late. Interpret the start time in TimeZone.currentSystemDefault() instead, so the alarm fires at the time displayed in the app. This matches the existing convention in Sessions.kt (tabSelected/closestTimeSlotKey), which already compares schedule times against the device's local now. Extract the conversion into a pure reminderTriggerAtMillis() helper in commonMain so it can be unit-tested deterministically with an explicit timezone. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Local notifications for favorited talks fire 2 hours late on Android for an event in Lille (
Europe/Paris).The backend returns schedule times as event-local wall-clock
LocalDateTimestrings with no offset, e.g.:AlarmScheduler.android.ktre-attachedTimeZone.UTCto that value, turning "08:30 Lille" into "08:30 UTC" = "10:30 Lille". The error equalsEurope/Paris's summer offset (CEST = UTC+2).Root cause
The backend is correct — it stores UTC instants and renders them into the event timezone for the V4 payload. The bug was solely on the consumer:
Fix
Interpret the start time in
TimeZone.currentSystemDefault()so the alarm fires at the time displayed in the app. This matches the existing convention inSessions.kt(tabSelected()/closestTimeSlotKey()), which already compares schedule times against the device's local "now".The conversion is extracted into a pure
reminderTriggerAtMillis()helper incommonMainso it can be unit-tested deterministically with an explicit timezone.Tests
ReminderTimeTest:"2026-06-11T08:30"inEurope/Paris+ 10-min reminder →06:20 UTC, with a regression guard asserting it is not08:20 UTC(the old behavior).:shared:core:desktopTest,:shared:core:compileAndroidMain,:shared:core:ktlintCheck,:shared:core:detektall pass.Known limitation
Uses the device timezone, which is correct for an attendee whose phone is in the event's zone. Making cross-timezone reminder-setting watertight would require exposing the event timezone (already in
EventsTable.timezone) through the client DTOs/DB — a larger follow-up.🤖 Generated with Claude Code