KnowledgeCanvas / knowledge

Knowledge is a tool for saving, searching, accessing, exploring and chatting with all of your favorite websites, documents and files.
Apache License 2.0
1.32k stars 92 forks source link

[Bug]: App force-reloads when PDFs are moved or cannot be found #92

Open RobRoyce opened 1 year ago

RobRoyce commented 1 year ago

Issue: if a PDF is moved from its original location, and the user attempts to open the Details view, the app force-reloads (losing any unsaved work). This error is already handled explicitly here, but by that point, it is too late, and the app is already in an inconsistent state (and therefore requires a reload).

Steps to recreate:

  1. Import any PDF
  2. Move it from its original location on disk
  3. Attempt to access the Details view

Solution 1: Perform a check before attempting to display files. If the file no longer exists, do the following:

Caveats:

RobRoyce commented 1 year ago

I think it would be easier to just check for the file dynamically. If it can't be loaded, just don't show the preview bar in details (or display a small error saying the file can't be located)