Skip to content

export obsidian: never prunes notes for removed nodes, so re-export merges old and new graphs #1896

Closed

Description

@Nyxx0x

Version: 0.9.15

graphify export obsidian writes notes for the current graph's nodes and refuses to overwrite files it does not recognise as its own — but it never deletes notes for nodes that no longer exist. Re-exporting over an existing vault therefore merges the old and new graphs into one pile.

Repro

  1. Extract, then export obsidian (graph A → vault holds A's notes).
  2. Change the corpus, or re-extract at a different mode, so the graph changes materially.
  3. export obsidian again into the same directory.

Actual

The vault holds old ∪ new. Observed after a full rebuild: 276 notes, of which 126 were orphans from the previous graph — the new graph had 187 nodes + 29 communities, i.e. 216 legitimate notes. Exit code 0, and no warning about the orphans. (It did warn that it skipped one pre-existing foreign file rather than overwrite it, so the exporter clearly already distinguishes its own files from other people's.)

Expected

Prune the notes the exporter itself previously wrote for nodes that are now absent — the ownership signal needed to do this safely already exists, given the overwrite protection. Failing that, warn with an orphan count so the merge isn't silent.

Workaround today is rm -rf on the vault directory before every export.

Activity

  1. safishamsi commented on Jul 14, 2026

    @safishamsi
    Member

    Fixed on v8 in 876c043 (will ship in 0.9.17). export obsidian now prunes notes for nodes that left the graph, deleting only files in graphify's own ownership manifest with a vault-containment guard, so user-authored notes are never touched.

  2. added a commit that references this issue on Jul 16, 2026
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