logseq / logseq/db-test

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

Open
#1,009 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
28
Forks
2
PR merge metrics
No merged PRs in 30d

Description

### Search first

- [x] 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:
```clojure
{: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!)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the three-dots menu's Import → File to DB graph entry point and reproduce with a markdown block tagged #scheduled and Import all tags enabled. Inspect the developer-console validation errors and the tag page's deletion behavior; done means the collision no longer creates an invalid entity and the resulting graph can be repaired without re-importing.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.