Repository navigation
Description
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
- Create a tag
Example Tag; on its page, add the aliasET. - In a block, type
#ET: the first entry is "Convert "ET" to tag", andExample Tagis not in the list. - Choose it:
ETloses its#Pagetag and becomes a tag of its own while staying the alias ofExample Tag. The block is tagged#ET, not#Example Tag. Afterwards, typing#ETno longer offersETat all, even though it is now a tag. - Click the
#ETchip on that block: it opensExample 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 onExample Tagmiss 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 viaclass-alias?, which reads:block/alias-source-page-class?. That key is derived from:block/_aliasinwith-explicit-ref-fields. As far as I can see, theget-blocksresponse never includes:block/_alias, so the guard never fires. - Why the tag isn't offered.
get-matched-classesadds each class's:block/aliasto the candidates, ahead of the class itself.get-all-classesreturnsentity->mapoutput, 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:ETis first collected asExample Tag's untitled alias, anddistinct-by :db/idthen drops the real, titledETclass, so#ETfinds 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 in2de6597811(14-05-2026, "fix: hide tag alias conversion action").fe65e36f13("refactor: remove ui db", 08-07-2026) changedclass-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
yuxi-liu-wired commentedon Oct 28, 2026
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.
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…
fix(editor): offer the tag, not "Convert to tag", when typing #alias-…