Skip to content

DB Graph Importer: user tag colliding with built-in property name (scheduled) produces invalid, undeletable entity #1009

Open
logseq/logseq
#13886

Description

@conan

Search first

  • I searched and no similar issues were found

What Happened?

I imported a file graph to a DB graph ("File to DB graph") with Import all tags checked. My file graph contained a block with the inline tag #scheduled:

- DONE figure out how to schedule things for [[February 22nd, 2021]] #scheduled

The import completed but reported "Import detected 14 invalid block(s)... See the javascript console for more." The console shows for the scheduled entity:

:errors
{:db/ident ["should be a valid user property namespace"],
 :block/tags ["should only have one tag for a built-in entity"],
 :logseq.property.class/extends {"user-property" ["disallowed key"]}}

Entity excerpt:

{:db/ident :user.class/scheduled-XswRbsld,
 :logseq.property/built-in? true,
 :logseq.property/type :datetime,
 :logseq.property.class/extends #{1},
 :block/name "scheduled",
 :dispatch-key :property}

Additionally, the resulting broken tag could not be deleted from the UI, so the graph cannot be repaired after import — the only recourse was to remove #scheduled from the source markdown and re-import from scratch.

Reproduce the Bug

  1. Create a file graph containing a block with the inline tag #scheduled (lowercase; presumably any tag matching a built-in property name reproduces this)
  2. Import via three dots menu → Import → File to DB graph, with Import all tags checked
  3. Observe "Import detected N invalid block(s)" warning
  4. Open the developer console (Ctrl+Shift+I) — the invalid entities are logged with their validation errors
  5. Attempt to delete the scheduled tag from its page — deletion fails

Expected Behavior

The importer should detect user tags/properties whose names collide with built-ins and either (a) merge the usage into the built-in property, (b) rename the user tag (e.g. scheduled-user), or (c) warn and skip — but never produce an entity that fails graph validation. Independently, invalid entities should be deletable so the graph can be repaired without a full re-import.

Screenshots

No response

Files

No response

Browser, Desktop or Mobile Platform Information

Logseq 2.0.1 (Windows x64, NSIS installer), Windows 11 desktop app. File graph originally created circa 2020–2021 on older Logseq versions.

Additional Context

Fixed at source by removing #scheduled from the markdown and re-importing; the re-import was clean.

Are you willing to submit a PR? If you know how to fix the bug.

  • I'm willing to submit a PR (Thank you!)

Activity

  1. LZong-tw commented on Jul 31, 2026

    @LZong-tw

    Update: reproduced and fixed on master locally.

    Repro (CLI)

    pnpm exec nbb-logseq script/db_import.cljs <file-graph-with-#scheduled> <db-name> -a -V
    
    • Without -a: Valid
    • With -a (Import all tags): previously created invalid :user.class/scheduled hybrid on top of :logseq.property/scheduled

    Fix

    convert-tag? no longer converts tags whose names collide with built-in property/class names (e.g. scheduled), so they stay page refs instead of overwriting the built-in entity uuid.

    Regression test: logseq.graph-parser.exporter-test/import-does-not-corrupt-built-in-property-when-tag-name-collides

    Will open a PR shortly if not already up.

  2. yuxi-liu-wired commented on Oct 27, 2026

    @yuxi-liu-wired

    Does not reproduce on current master (d06ded9971): importing a file graph with #scheduled and #deadline (convert-all-tags on, as a journal tag, in a page file and as a tags:: value, and the exact line from this issue) creates a separate :user.class/scheduled tag and the graph validates. If it still happens for you on a recent build, the graph (or a small part of it) would help.

  3. yuxi-liu-wired commented on Oct 27, 2026

    @yuxi-liu-wired

    It does reproduce on current master with both in the same file: with convert-all-tags on, #scheduled on one block and scheduled:: true on another block of the same page give one entity user.class/scheduled that is both a class and a property, and the graph fails validation ("disallowed key"). A tag alone, as tried above, imports fine. A fix is being worked on.

  4. added 12 commits that reference this issue on Oct 27, 2026
    41fe859
    43060e7
    1897f43
    c909c92
    16ca20e
    1b8cfd4
    3678a77
    5165d18
    e8b4e23
    818fb9e
    0d468b1
    6206922
  5. 1 remaining item

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