fix(import): preserve source file timestamps by megayu · Pull Request #13032 · logseq/logseq · GitHub
Skip to content

fix(import): preserve source file timestamps - #13032

Open
megayu wants to merge 3 commits into
masterfrom
fix/file-import-timestamps
Open

fix(import): preserve source file timestamps#13032
megayu wants to merge 3 commits into
masterfrom
fix/file-import-timestamps

Conversation

@megayu

@megayu megayu commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes import/export timestamp handling so DB-graph imports can preserve the source file’s filesystem timestamps (created/modified), aligning imported page/block timestamps with the original files and addressing logseq/db-test#1047.

Changes:

  • Capture per-file filesystem timestamps during UI-driven imports and include them in the serialized file payload.
  • Teach export-doc-file to prefer provided :file-created-at / :file-updated-at values (already in ms) over recomputing from file stat.
  • Allow importing :block/created-at / :block/updated-at for “file pages” so existing pages can be updated with preserved timestamps.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/main/frontend/components/imports.cljs Adds Electron stat lookup and forwards source timestamps into the import payload.
deps/graph-parser/src/logseq/graph_parser/exporter.cljs Uses provided ms timestamps and conditionally allows page timestamp attrs for file-backed pages.
deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs Updates/extends test coverage to assert filesystem timestamps are preserved through export/import.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/main/frontend/components/imports.cljs Outdated
Comment thread deps/graph-parser/src/logseq/graph_parser/exporter.cljs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some pages have wrong creation and update date after import

2 participants