Skip to content

fix: treat cleared deadline/scheduled as absent when repeating - #13506

Open
tiensonqin wants to merge 3 commits into
masterfrom
logseq/fix-repeat-empty-placeholder-fa5a
Open

tiensonqin wants to merge 3 commits into
masterfrom
logseq/fix-repeat-empty-placeholder-fa5a

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes logseq/db-test#1353

Date-picker delete keeps Deadline/Scheduled on the block and writes :logseq.property/empty-placeholder. Checking a repeating task then ran the worker repeat command, which coerced that keyword with tc/to-date-time and aborted the whole set-block-property transaction. The task stayed Todo with today's date.

Treat empty-placeholder as an absent date in frontend.worker.commands:

  • present-date-value unwraps a real date/datetime or nil for unset/cleared values; empty-placeholder-value? matches both the keyword (scalar :datetime) and the placeholder entity (ref-typed values) — :db/ident reads through a datascript Entity, which map? would miss.
  • reschedule-property-idents and existing-repeat-temporal-property-idents skip cleared companion dates; get-next-time/compute-reschedule-property-tx skip cleared values before tc/to-date-time.

Checking the task then succeeds. A remaining real date advances; a cleared date is left empty. Same result as removing the companion property entirely.

Tests

frontend.worker.commands-test covers the issue cases in UTC and Asia/Tokyo:

  • Deadline repeating after Scheduled is cleared
  • repeating Deadline itself cleared
  • Scheduled repeating after Deadline is cleared
  • checkbox / set-block-property path through the worker pipeline
  • get-next-time on the keyword and on a real placeholder Entity

LOGSEQ_STABLE_IDENTS=1 node static/tests.js -n frontend.worker.commands-test: 20 tests, 114 assertions, 0 failures.

Link to Devin session: https://app.devin.ai/sessions/5f41fc5e552b4b3a8aad9a055b935141
Open in Devin Desktop: https://app.devin.ai/desktop/session/5f41fc5e552b4b3a8aad9a055b935141?variant=devin
Requested by: @megayu

cursoragent and others added 2 commits October 2, 2026 08:54
Date-picker delete keeps the property and writes empty-placeholder.
Repeat advance coerced that keyword with to-date-time and aborted the
status transaction. Treat the placeholder as no date.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Replace some->/cond-> in reschedule with an explicit if so the
empty-placeholder skip is one clear path.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the logseq/fix-repeat-empty-placeholder-fa5a branch from 192f3b2 to e479a1d Compare October 2, 2026 08:54
A datascript Entity is ILookup/IAssociative but not IMap, so the map?
guard never matched a real placeholder entity — only the plain-map stubs
in tests. Compare :db/ident directly (nil-safe on scalars) and cover the
entity path with d/entity in the test.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 2, 2026 09:17

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 2 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

This branch has not been deployed

No deployments
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.

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

3 participants