Documents/Books hang if any of the XDG_*_DIR vars are not defined (e.g. commented out in ~/.config/user-dirs.dirs)
TL;DR: Documents/Books hang on undefined XDG_*_DIR vars.
For the XDG user dirs I don't use (e.g. "public" on any machine, or music/videos on a work machine), I had them commented out in
~/.config/user-dirs.dirs and put
~/.config/user-dirs.conf, in order to keep them from cluttering up the sidebars of Nautilus and every GTK+ open/save dialogue (since Nautilus/GTK+ don't make it possible to switch off "show every XDG dir in the sidebar" - the sort of decision Apple would probably call "courageous" ;)).
Many happy uncluttered Nautilus/GTK+ years later, I found that Documents/Books were (partially) hanging on startup, and tracked it down today to being a result of any XDG_*_DIR var being undefined.
After looking again at https://www.freedesktop.org/wiki/Software/xdg-user-dirs/ I realised that the "correct" (?) way of "disabling" an XDG dir is actually by pointing it at $HOME, not by preventing its definition like I had. But it would be good if Documents/Books handled missing XDG dir vars gracefully anyway.
Output with any of the vars undefined:
$ gjs-console /usr/bin/gnome-documents (org.gnome.Documents:16073): Gjs-WARNING **: 23:39:41.677: JS ERROR: Exception in callback for signal: window-mode-changed: Error: Argument 'path' (type filename) may not be null Source<._getTrackerLocations/<@resource:///org/gnome/Documents/js/search.js:372:32 ...
$ gnome-books (org.gnome.Books:19007): Gjs-WARNING **: 23:40:24.347: JS ERROR: Exception in callback for signal: window-mode-changed: Error: Argument 'path' (type filename) may not be null Source<._getTrackerLocations/<@resource:///org/gnome/Books/js/search.js:372:32
Either app then doesn't draw its title bar (just has a black "undrawn" region, and shows an empty content area. App menu items still work though.