org-roam / org-roam-ui

A graphical frontend for exploring your org-roam Zettelkasten
GNU General Public License v3.0
1.93k stars 106 forks source link

[BUG] Strange prompt on graph load #167

Open egrefen opened 2 years ago

egrefen commented 2 years ago

Describe the bug When loading the org-roam-ui graph in a new window (at start up, or when already running), the graph does not load, and within emacs the user is prompted to select which pdf to use for a particular bibtex entry (which doesn't necessarily need to have a lit note node in the graph yet).

To Reproduce Pre-condition: have org-roam-bibtex installed, and have bibtex-completion-bibliography pointing to a bibtex with one or more entries that have a file attribute with multiple files (e.g. a paper and supplementary material), such as

file = {/Users/egrefen/Zotero/storage/XPKKVARQ/Ghosh et al. - 2021 - Why Generalization in RL is Difficult Epistemic P.pdf;/Users/egrefen/Zotero/storage/2AIN5PAZ/2107.html}
  1. Start org-roam-ui server.
  2. Open a browser window pointing to the server.
  3. Note that the UI loads, but not the graph.
  4. Check emacs and observe the completing-read prompt appears asking which file to use.

Expected behavior The graph should load without prompting the user for this information.

Screenshots

Screenshot 2021-11-24 at 11 59 39

What browser were you using? Chrome

Additional context I had pulled the latest versions of my packages using doom sync -u before reporting this.

egrefen commented 2 years ago

It's likely this is not the fault of org-roam-ui, but it would be helpful to identify what part of the loading of the graph causes this behaviour to arise, so as to find the right thing to debug.

einsiedlerspiel commented 2 years ago

The Problem is this call of orb--pre-expand-template https://github.com/org-roam/org-roam-ui/blob/df1f9522c5a9cdb248208427fa9df4f2a7666e2a/org-roam-ui.el#L344-L345

If orb-preformat-keywords does contain the keyword file and the bibtex entry has more than one file associated the template expansion will ask what file to use.

The issue is solved by making sure that the file keyword is not in that list at the time of the call.