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:
Import any PDF
Move it from its original location on disk
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:
Prompt the user to locate it (assuming they know where it has been moved to)
If the user does/can not locate it, ask if they want to:
Disable the preview feature for that particular Source
Remove the Source entirely
Caveats:
If we do allow the ability to keep a Source when a file is moved, we must either:
Add a flag to the SourceModel saying the preview should be disabled. This will involve additional overhead and house keeping, or
Create a "blacklist" of Sources that are not allowed to be previewed (easier and less overhead, but not very elegant)
If we do not allow the ability to keep a Source when a file is moved, the user risks losing valuable data. This should be handled gracefully if possible (prompt the user to export any associated data before removing the source)
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)
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:
Details
viewSolution 1: Perform a check before attempting to display files. If the file no longer exists, do the following:
Source
Source
entirelyCaveats:
Source
when a file is moved, we must either:SourceModel
saying the preview should be disabled. This will involve additional overhead and house keeping, orSources
that are not allowed to be previewed (easier and less overhead, but not very elegant)Source
when a file is moved, the user risks losing valuable data. This should be handled gracefully if possible (prompt the user to export any associated data before removing the source)