As suggested, I posted this as a bug at github a while ago. There was little response. I'm hoping that the assembled wise here will be able to provide some context for the behavior I'm seeing.
At some point I attempted to create new "notebooks" and they now no longer appear in the Notebook List. The notes that were in these notebooks still exist and behave normally, ie., they are updated and synced as expected; moreover, if I do a search that finds them, they are found and there's a blue box above that proclaims them to be in the Notebook I originally assigned them. Clicking on that blue box duly brings up all the notes in that Notebook. So, all good, BUT, that notebook does not appear in the Notebook List in the sidebar.
In the console,
Folder.all() gets me an array of all the "notebooks", or folders, including the ones that don't appear in the Notebook List in the sidebar.
Folder.allAsTree() gets me an array of just the "notebooks" or "folders" that appear in the notebook list in the sidebar. So, my question is: Is there an operational distinction between "Notebook" and "Folder"? And, is there any way to force the missing folders to appear in the Notebook List?
I'm seeing this behavior in all three of my clients: 2.5.12 in both the Mac (11.6 arm) and Linux (5.11.0 Ubuntu/popOS) boxes, and 2.4.3 on my Android phone. I'm syncing via webDAV
The Stale Bot at Github, referring to itself in the first person, keeps pestering me, saying "Hey there, it looks like there has been no activity on this issue recently." I guess I'll go ahead and let that bug lapse for lack of interest. I'm also not confident that it IS a bug; more likely, it's simply my misunderstanding of how Folders and Notebooks are supposed to work. If anyone has any insight on this and can illuminate me in this forum, I'd sure like to understand this puzzling behavior.
From what I gather by looking at the code, the only reason a folder would appear in
Folder.all but not in
Folder.allAsTree is if its
parent_id refers to a non-existent folder (might not be a direct parent but
parent_id of a parent etc).
If you know how, you could open Joplin's database with any sqlite editor and identify the invalid
parent_id. If you then clear it, it will make the missing folder appear at the top-level and from there you can move wherever it belongs.
I suspect, this was caused by come error during synchronization but it may be hard if not impossible to tell now.
Roman, brilliant! yes. For convenience's sake I've downloaded "DB Browser for SQLite" for the Mac and it seems to work well. The missing notebooks are indeed shown in the database as having a parent id for a folder that doesn't exist. If I delete in the db the
parent_id for each of those folders, will my change propagate to my other clients on sync?
Not unless you also change updated_time. Or it may be easier to change the folder from Joplin, e.g. rename it. This should get it to sync.
yeah, catch22: the folder doesn't appear in the Joplin UI, so I can't rename it there. How about if I create new "notebooks" move the relevant notes to them and then simply delete the old child "folders" in the db. Would that sync?
I think this should work (but make a backup first!).
But what I meant when I spoke about renaming was first you clear the parent_id using DB Browser for SQLite, then you start Joplin, see your folder at the top-level, and move/rename it. And then sync.
I get it now, so I tried it. I simply cleared the
parent_id for the four absent folders and on restart, lo, they then appeared in the notebook list. Alas, this change did not propagate to my Android and Linux clients on sync. But then I renamed the offending folders, and voila, the renamed notebooks appeared in my other clients on sync. Problem solved! Thanks very much @roman_r_m!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.