Skip to content

fix(tasks): don't wrap reminders into the past when repeating from current date - #3547

Merged
kolaente merged 1 commit into
mainfrom
recurring-reminder-overflow
Aug 18, 2026
Merged

fix(tasks): don't wrap reminders into the past when repeating from current date#3547
kolaente merged 1 commit into
mainfrom
recurring-reminder-overflow

Conversation

@tink-bot

Copy link
Copy Markdown
Collaborator

Repeat-from-current-date tasks with reminders more than ~292 years apart got a reminder shifted centuries into past (1744 instead of 2036). time.Time.Sub saturates time.Duration at MaxInt64, adding repeat interval overflowed negative. Also drops in-place sort.Slice that reordered reminders on aliased slice.

How to verify

  1. Create a task with repeat_after=315360000, repeat_mode=2 and reminders 1734-01-01T00:00:00Z and 2026-01-01T00:00:00Z.
  2. Mark the task done via POST /api/v1/tasks/{id} with {"done":true} and refetch it.
  3. Expected: the first reminder is now + 10 years (around 2036), the second is 292 years after that (around 2328), and reminder order is unchanged.
    Before this PR: the second reminder was persisted around 1744 and the reminders came back reordered.

…rrent date

Offsets between reminders spanning more than ~292 years overflowed
time.Duration, so the shifted reminder landed centuries in the past.
Shift dates via a helper that falls back to year arithmetic when
time.Time.Sub saturates, and stop sorting the reminders in place.
@kolaente
kolaente enabled auto-merge (rebase) August 18, 2026 11:27
@github-actions github-actions Bot added area/recurring-tasks Repeat rules, recurring task behavior, RRULE area/reminders Task reminders labels Aug 18, 2026
@github-actions

Copy link
Copy Markdown

Preview Deployment

Preview deployments for this PR are available at:

URL Tag Commit
https://pr-3547.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:pr-3547 latest
https://sha-f0149ef458cd35926c5d28c3f807875a9361fed3.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-f0149ef458cd35926c5d28c3f807875a9361fed3 f0149ef

The preview environment will start automatically on first visit. Subsequent pushes to this PR will update the pr-3547 image — the preview picks up the new version on restart. The per-commit URLs point to a specific version and will not change.

Run locally with Docker
docker pull ghcr.io/go-vikunja/vikunja:pr-3547
docker run -p 3456:3456 ghcr.io/go-vikunja/vikunja:pr-3547

Last updated for commit f0149ef

@kolaente
kolaente merged commit 9aad78a into main Aug 18, 2026
79 of 80 checks passed
@kolaente
kolaente deleted the recurring-reminder-overflow branch August 18, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/recurring-tasks Repeat rules, recurring task behavior, RRULE area/reminders Task reminders

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants