Skip to content

DB: Redo of repeating-task completion advances Scheduled/Deadline one extra interval #1387

Closed
logseq/logseq
#13562

Description

@tiensonqin

Search first

  • Searched open/closed db-test reports and related active PRs

What happened?

Completing a repeating task advances its date once. Undo restores the original date, but Redo advances one more interval than the original completed-action result.

A daily Deadline reproduces this without a DST boundary: Oct 10 → Done → Oct 11 → Undo → Oct 10 → Redo → Oct 12.

Minimal reproduction

Tested in a disposable local DB graph, no sync.

  1. Create an ordinary page and a task titled QA redo day. Save the title before configuring dates.
  2. Add Deadline using the slash command. Select October 10, 2026, with the time at 12:00 AM.
  3. In its date picker, enable Repeat task:
    • Every: 1 Day
    • Next date: Advance from scheduled (the + rule)
    • When: Status, is Done
  4. Close and reopen the picker to verify the saved date/rule, then close it.
  5. Open the task's status circle menu and select Done once. It returns to Todo and its Deadline becomes October 11, 2026.
  6. Click blank space so no text editor is focused. Press Ctrl+Z once. Deadline returns to October 10.
  7. Press Ctrl+Shift+Z once. Deadline becomes October 12, rather than restoring October 11.
  8. Reload with Ctrl+R. October 12 remains.

The test was run on Oct 1, 2026. The + rule advances exactly once from the selected date even when completed early; no clock changes were made.

Expected

Redo restores the original completed-action outcome: Todo with Deadline October 11. It must not run the recurrence side effect a second time on top of the recorded post-completion date.

Actual / repeatability

  • Daily Deadline: Oct 10 → Oct 11 → Undo Oct 10 → Redo Oct 12; wrong date persists reload
  • Separate weekly Scheduled task: Oct 31 00:00 → original Done result Nov 6 23:00 → Undo Oct 31 → Redo Nov 13 23:00
  • A second Undo/Redo cycle on the weekly task again returns Oct 31 → Nov 13 23:00; it does not keep accumulating further weeks in this fixture
  • 3/3 Redo cycles across two separately created tasks, covering Deadline and Scheduled, show an extra interval
  • Both wrong post-Redo dates persist reload; task titles remain intact and status returns to Todo

The weekly fixture's initial one-hour/DST drift is already documented in #1295. This report is about the additional whole recurrence interval on Redo. The daily Oct 10–12 case has no DST transition.

Related history work

  • #1339 proposes general local transaction replay changes, without this recurrence example
  • Open/unmerged logseq/logseq#13545 is potentially relevant: its local-history replay bypasses derived pipeline work and may fix this symptom. This is a source-based inference; that branch was not tested, and no recurrence-specific assertion was found
  • logseq/logseq#13466 is closed without merge and continued in #13545
  • Open logseq/logseq#13553 guards template generation on replay, but its current patch does not guard repeating-task commands
  • #1353 concerns a cleared temporal placeholder; no date was cleared here

Likely source path, not a confirmed fix: current history replay can include the added Done datom and already advanced date, while compute-extra-tx-data still invokes commands/run-commands on Redo. That can derive a second recurrence step from the recorded advanced value.

Platform

  • Debian GNU/Linux 13, x86_64
  • Logseq DB 2.0.1, development Electron app
  • Master SHA 8ffbb220938acc00e1c70e8579e7c52ab97c2aa7; clean checkout, still current at 15:48 UTC
  • Live renderer and Node worker verified 8ffbb22, build 2026-10-01T14:32:34Z
  • Electron 42.3.0 / Chromium 148.0.7778.180
  • Actual app timezone America/Los_Angeles
  • Local disposable graph; authenticated sync untested
  • Web untested because the environment's cloud-browser route to the local dev server was blocked by the client
  • Reproduced through native desktop input; no source or direct database modifications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions