Skip to content

App wedges on startup if the last-opened graph directory is deleted (fails to fallback) #1532

Closed

Description

@JaredStemper

name: Bug Report
about: App wedges on startup if the last-opened graph directory is deleted (fails to fallback)
title: 'App wedges on startup if the last-opened graph directory is deleted (fails to fallback)'
labels: ''
assignees: ''


What Happened?

If the Logseq Desktop app attempts to boot into a graph that has been deleted from the filesystem and unregistered from graphs.edn, it fails to catch the resulting Graph is absent or stopped by deletion IPC error.

Instead of gracefully falling back to the Welcome Screen or the next available graph in the registry, the UI permanently wedges on a blank/loading screen, effectively locking the user out of the application until they manually destroy the Electron Local Storage cache.

Reproduce the Bug

  1. Open Logseq Desktop and load any valid DB graph (e.g., test-graph).
  2. Quit Logseq completely.
  3. In the filesystem, delete the test-graph directory and remove its entry from ~/.logseq/graphs.edn.
  4. Open Logseq Desktop.

Result: The UI freezes on startup. The background worker throws continuous IPC errors in main.log, and there is no UI state provided to select a different valid graph.

Expected Behavior

Logseq should detect that the cached last-opened graph is missing/unregistered, clear the current_repo state from localStorage, and route the user to the Welcome Screen (or load the first valid graph in graphs.edn).

Screenshots

N/A (UI freezes on boot)

Desktop or Mobile Platform Information

  • OS: macOS (Apple Silicon)
  • Logseq Version: 2.0.x (DB version)

Additional Context

The main.log spams the following exception during the wedged state:

[error] IPC error:  {:event #object[Event [object Object]], :args "[\"~#list\",[\"db-worker-runtime\",\"logseq_db_test-graph\",[\"^ \",\"~:generation\",null]]]"} Error: Graph is absent or stopped by deletion
    at fail (.../@logseq/graph-lifecycle/index.cjs:20:23)
    at async Object.startGraph (.../@logseq/graph-lifecycle/index.cjs:713:20)

Workaround / Recovery:
The only way to recover the application is to manually destroy the Electron Local Storage cache via the terminal, which resets the last-opened graph memory:

rm -rf ~/Library/Application\ Support/Logseq/Local\ Storage/leveldb

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