{{ message }}
Repository navigation
fix(db): date-named tags create valid classes - #13779
Open
tiensonqin wants to merge 2 commits into
Open
tiensonqin wants to merge 2 commits into
tiensonqin wants to merge 2 commits into
Conversation
Creating a tag or class whose title looks like a date no longer attaches journal-day, a journal UUID, or original-page-name. The entity is a normal class that extends Root and passes closed-schema validation. Existing journal pages with the same title stay journals. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Contributor
Author
Class create skips journal conversion, so a title like 2026/05/18 no longer has journal-day. Treat slash journal titles as a single class instead of splitting them into parent tags. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
This branch has not been deployed
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.

Fixes logseq/db-test#1447
Problem
In DB graphs, creating a tag/class whose title looks like a date produced an invalid hybrid entity: a
Tagthat also carried:block/journal-day, the deterministic journal UUID (00000001-YYYY-MMDD-0000-000000000000), and sometimes:block.temp/original-page-name. Closed-schema validation then failed (:block/journal-day/:block.temp/original-page-namedisallowed on a class page,:logseq.property.class/extendsmissing/wrong, ident should be:logseq.class/Root).Paths:
#2024-01-01,#[[2024-01-01]],#x[[Jan 1st, 2024]]outliner-page/create!with{:class? true}and titleJan 1st, 2024/jan 1st, 2024/2024-01-01Root cause:
page-name-string->mapranconvert-page-if-journalwhenever the title parsed as a date, including whenclass?was true. Journal attributes then leaked into class construction.Design choice
Create a plain valid class from a date-like title (option a), rather than refusing the name (option b).
Why:
#2024-01-01should tag, not fail).skip-journal?for this distinction; using it is the smallest consistent change.20240101/jan 1st, 2024x, which already worked.#x[[Jan 1st, 2024]]also does not create a journal-attributed class. A page ref such as[[2024-01-01]]still creates a journal.The resulting class has no
:block/journal-day, no journal UUID, no persisted:block.temp/original-page-name,:logseq.property.class/extends :logseq.class/Root, and a normaluser.classident.Slash journal titles such as
2026/05/18stay a single class even whensplit-namespace?is true (the frontend default). They are dates, not parent/child namespaces.Changes
class?; do not convert an existing journal into a class; do not split slash journal titles into namespace tags.build-new-class: strip leftover journal identity (journal-day, original-page-name, journal/page tags, journal UUID).Tests
logseq.graph-parser.block-testlogseq.outliner.page-testlogseq.db.frontend.class-testfrontend.handler.db-based.editor-test(wrap-parse-block)frontend.worker.pipeline-test(save-block + closed-schema validation)No editor UI behavior change, so no clj-e2e coverage added.