Skip to content

Checking a repeating task fails after its Deadline or Scheduled is cleared with the date picker's delete button #1353

Closed
logseq/logseq
#13616

Description

@yuxi-liu-wired

Steps

In any time zone:

  1. Create a task. Add Deadline with /deadline and Scheduled with /scheduled, both today, no time.
  2. Click the Scheduled value to open its date picker and click the trash button next to the month arrows. Scheduled stays on the task with no date.
  3. Click the Deadline value, tick "Repeat task" in its date picker and leave the other repeat settings at their defaults.
  4. Click the task's checkbox.

Expected

The task is Todo again with Deadline tomorrow. That is the result when step 2 removes the Scheduled property instead of clearing its date.

Actual

The task stays Todo and Deadline stays today. The worker rejects the transaction that sets the status, with No protocol method ICoerce.to-date-time defined for type cljs.core/Keyword: :logseq.property/empty-placeholder (logged as transact-failed, outliner op set-block-property). UTC and Asia/Tokyo give the same result.

More cases, each measured in UTC and Asia/Tokyo:

  • The repeating date itself cleared: Deadline today, "Repeat task" ticked, then Deadline cleared with the trash button, then the checkbox. The task stays Todo.
  • Scheduled repeating, Deadline cleared: Scheduled and Deadline today, Deadline cleared, "Repeat task" ticked on Scheduled, then the checkbox. The task stays Todo.
  • The task of the steps above completed with the cycle-todo command (mod+enter) instead of the checkbox: Todo to Doing works, Doing to Done fails, and the task stays Doing.

Backspace or Delete on a focused date value clears it the same way as the trash button (date-picker-handle-delete!, src/main/frontend/components/property/value.cljs:946; read from the code, not measured).

Cause

The trash button (DelDateButton, src/main/frontend/ui.cljs:1001) calls clear-date-property-value! (src/main/frontend/components/property/value.cljs:938), which keeps the property on the block and sets its value to :logseq.property/empty-placeholder. Deadline and Scheduled are :datetime properties, a scalar type, so the block holds that keyword as the value. The date picker reads the keyword as no value (date-property-value-present?, line 931); the repeat command does not.

When a repeating task becomes Done, the worker pipeline runs the repeat command (commands/run-commands, src/main/frontend/worker/pipeline.cljs:548). reschedule-property-idents (src/main/frontend/worker/commands.cljs:247) takes the repeat's own property, plus the other of Deadline and Scheduled when the block has it, by a truthiness test (lines 253 and 257); the keyword passes that test. compute-reschedule-property-tx (line 202) reads the keyword as current-value (line 211), its guard (and frequency unit current-value) (line 222) lets it through, and get-next-time calls tc/to-date-time on it (line 164), which has no method for keywords and throws. The pipeline runs inside transact-sync (deps/db/src/logseq/db.cljs:154) before the new db replaces the old one (line 175), so the exception discards the whole transaction, the status change included.

How found

A model-based property test of dates (frontend.worker.date-model-property-test, branch test/date-model-fuzz on upstream master 16c4ed1a0) sends every operation through the worker's apply-ops! with the arguments the UI sends, with the worker pipeline that runs the repeat command. After each operation it checks that the operation applied, was refused with a notification, or did nothing; checking the task threw. Shortest sequence measured: 4 operations, Deadline set to today without a time, "Repeat task" ticked on Deadline, Deadline cleared, task checked. The steps, the cases above and the removed-Scheduled comparison in Expected are replays on master 16c4ed1a0 on 2026-09-27, in UTC and Asia/Tokyo, with the task checked at 12:00 local time on 2026-09-27.

Activity

  1. yuxi-liu-wired commented on Oct 6, 2026

    @yuxi-liu-wired
    Author
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