Future-Scholars / paperlib

An open-source academic paper management tool.
https://paperlib.app
GNU General Public License v3.0
1.56k stars 67 forks source link

[BUG?] Tag list missing after metadata syncing #616

Closed Yorxin closed 1 month ago

Yorxin commented 1 month ago

After opening paperlib and waiting it to finish metadata syncing, my sidebar is empty without any tags I have created on another PC, although every paper still has its tag correctly attached to it. Screenshot below:

Untitled
GeoffreyChen777 commented 1 month ago

Hi, open the MongoDB web dashboard:

Screenshot 2024-09-26 at 19 00 39

Click the browser collections

Search paper tags with name Tags

Screenshot 2024-09-26 at 19 02 04

There should be two results and one is with no children. Delete it.

Yorxin commented 1 month ago

Thanks for your reply. I found multiple results matching {name:"Tags"} in this place, and I kept only one with highest number of children (which is 36, but I have more than 80 tags created I think) and deleted the others, then I opened paperlib and found it couldn't link to that list. it's still empty. I think I have messed it up. Is it advisable to delete all the tags and the left taglist in Mongo and recreate them in paperlib from scratch?

Yorxin commented 1 month ago

I have solved my problem finally. As I said before, I left only one name: "Tags" item and deleted the others, but this name: "Tags" item didn't include all the tags I had created. Then when I opened Paperlib, I found that my tag list remained empty. For testing, I created 2 new tags this and that, dragged some papers into them and found their "full" tag names were video/this and video/that. video was a tag I created before, so I guessed Paperlib failed to link up with the only left name: "Tags" but elsewhere took video as the tag list, and I did find video got 2 children in Mongo (maybe because video wasn't in the name: "Tags" children list and had no parent, and Paperlib just "randomly" chose an parentless item as the tag list). Then I copied all ObjectId of my tags and added them into the children list of the name: "Tags" item and solved the problem. I think it'd be better if Paperlib only chooses an item fulfilling name=="Tags" as a potential tag list. And I find that if a tag named, say, "video" exists in Mongo but not in the current tag list in Paperlib, I cannot "re-arrange" this missed tag into the current tag list by just recreating a tag name "video" in Paperlib (which is much more easier), but have to copy the ObjectId in Mongo as a workaround.