Skip to content

#<alias of a tag> offers "Convert to tag" instead of the tag; since 2.0.2 choosing it turns the alias into a separate tag #1450

Closed

Description

@hugoideler

Search first

  • I searched and no similar issues were found

What Happened?

A tag Example Tag has the alias ET. Typing #ET in a block shows "Convert "ET" to tag" as the first entry, and Example Tag is not offered. On 2.0.1, choosing that entry tagged the block with Example Tag. On 2.0.2, choosing it converts ET into a separate tag and tags the block with #ET. Typing [[ET works correctly in both versions ("ET -> alias: Example Tag"). Seen on desktop and iOS.

Reproduce the Bug

  1. Create a tag Example Tag; on its page, add the alias ET.
  2. In a block, type #ET: the first entry is "Convert "ET" to tag", and Example Tag is not in the list.
  3. Choose it: ET loses its #Page tag and becomes a tag of its own while staying the alias of Example Tag. The block is tagged #ET, not #Example Tag. Afterwards, typing #ET no longer offers ET at all, even though it is now a tag.
  4. Click the #ET chip on that block: it opens Example Tag (alias redirect). There, the block is missing from the tag's table and appears only under Linked references (via the alias), so tag-based views and queries on Example Tag miss it.

Expected Behavior

#ET offers Example Tag and tags the block with it. A page that is an alias of a tag should not be offered for conversion. Per #520, aliases may point to any node, tags included.

Screenshots

No response

Files

No response

Browser, Desktop or Mobile Platform Information

Desktop 2.0.1 (43a540f) and 2.0.2 (533ac43); iOS TestFlight 2.0.1 and 2.0.2.

Additional Context

This section was produced with an AI assistant reading the source at 43a540f and 533ac43; it was not verified at runtime and I can't vouch for the details myself. The reproduction steps above are my own observations.

  • Why 2.0.1 seemed to work. tag-on-chosen-handler (handler/page.cljs) refetched the chosen item before reading :convert-page-to-tag?, so the conversion never ran (bug: tagging via autocomplete "convert page to tag" inserts #[[<class-uuid>]] instead of a tag (regression from fe65e36f13) #1270). The handler then fell through to its alias fallback (<get-alias-source-page), which swapped in the tag.
  • What 2.0.2 changed. fix: convert-page-to-tag autocomplete entry does nothing logseq#13392 (0b9129057e) reads the flag before the refetch, so the conversion now runs. Afterwards the page is a tag, so the alias fallback no longer applies.
  • Why Convert is offered at all. search-pages (components/editor.cljs) is meant to skip it for tag aliases via class-alias?, which reads :block/alias-source-page-class?. That key is derived from :block/_alias in with-explicit-ref-fields. As far as I can see, the get-blocks response never includes :block/_alias, so the guard never fires.
  • Why the tag isn't offered. get-matched-classes adds each class's :block/alias to the candidates, ahead of the class itself. get-all-classes returns entity->map output, and a nested alias entity is serialized as {:db/id} without :block/title, so the fuzzy title match never hits it. The state after step 3 shows this: ET is first collected as Example Tag's untitled alias, and distinct-by :db/id then drops the real, titled ET class, so #ET finds nothing.
  • Possible minimal fix. In tag-on-chosen-handler, resolve the alias source before converting, and skip the conversion when that source is a class. Fixing either of the two points above would also prevent it.
  • History. Showing tag aliases in # completion and hiding "Convert" for them was added on purpose in 2de6597811 (14-05-2026, "fix: hide tag alias conversion action"). fe65e36f13 ("refactor: remove ui db", 08-07-2026) changed class-alias? to read the serialized :block/alias-source-page-class? flag instead of :block/_alias, which appears to be where both the guard and the alias candidates stopped working. bug: tagging via autocomplete "convert page to tag" inserts #[[<class-uuid>]] instead of a tag (regression from fe65e36f13) #1270 then hid this until fix: convert-page-to-tag autocomplete entry does nothing logseq#13392 fixed it.

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. yuxi-liu-wired commented on Oct 28, 2026

    @yuxi-liu-wired

    Fixed in logseq/logseq#13897 (fix: file:// image paths, #alias of a tag, Validate graph report, PDF viewer after reload). Its description has the cause and the test that pins it; it fails on current master and passes with the fix.

  2. added 4 commits that reference this issue on Oct 29, 2026
    a3cd793
    48a396b
    3487f7c
    0ed20b7
  3. added 19 commits that reference this issue on Nov 11, 2026
    330b9f5
    450e88a
    e452d26
    3922d0b
    43adf57
    dd0a96c
    38b921b
    8511b91
    1d76b17
    7826d08
    97aac67
    133ca4e
    ae125ce
    bedf620
    5078a92
    c6b0c45
    a83986d
    de1e4f0
    8f5cb1e
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