Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RobRoyce opened this issue Feb 21, 2023 · 1 comment
Open

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

RobRoyce opened this issue Feb 21, 2023 · 1 comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@RobRoyce
Copy link
Member

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:

  • 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)
@RobRoyce RobRoyce added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Feb 21, 2023
@RobRoyce RobRoyce changed the title [Bug]: App reloads when PDFs are moved or cannot be found [Bug]: App force-reloads when PDFs are moved or cannot be found Feb 21, 2023
@RobRoyce
Copy link
Member Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant