logseq / logseq/db-test

[Bug] Migrated assets from OG to DB are missing in Publish/Sync

Open
#1,110 0 comments 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
  • I searched and no similar issues were found
What Happened?

After migrating a graph from file-based (OG) mode to DB mode, migrated images/assets do not appear in Publish or Sync (shows not published), while they display correctly locally.
Root Cause:
During migration, build-new-asset in deps/graph-parser/src/logseq/graph_parser/exporter.cljs hardcodes :block/page and :block/parent to :logseq.class/Asset (the built-in class page) instead of the actual user page that references the asset.
The publishing filter in deps/publishing/src/logseq/publishing/db.cljs (filter-only-public-pages-and-blocks) only keeps entities whose :block/page points to a public user page. As a result, migrated assets are filtered out and their files are not included in the publish package.
In contrast, assets created by drag-and-drop in DB mode are correctly attached to the current user page and work normally in Publish/Sync.

Reproduce the Bug

Migrate an OG graph containing images to DB format.
Images display normally in the local DB graph.
Publish the graph (using “Only publish public pages” mode).
Migrated images are missing and clik the link will show "Page not published" on the published site.
(Control) Newly drag-and-dropped images in the same DB graph publish correctly.

Expected Behavior

Migrated assets should be attached to the user page(s) that reference them (same as drag-and-drop assets) and be properly included in Publish and Sync outputs.

Screenshots

local:

Image Image

published:

Image Image
Desktop or Mobile Platform Information

No response

Additional Context

No response

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

Read build-new-asset in deps/graph-parser/src/logseq/graph_parser/exporter.cljs, then trace filter-only-public-pages-and-blocks in deps/publishing/src/logseq/publishing/db.cljs. Compare migrated assets with drag-and-drop assets and verify that assets referenced by public user pages are included in Publish and Sync outputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.