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

File & Folder Add/Change Handling #14

Open
guswelter opened this issue Aug 12, 2021 · 1 comment
Open

File & Folder Add/Change Handling #14

guswelter opened this issue Aug 12, 2021 · 1 comment
Assignees

Comments

@guswelter
Copy link
Contributor

guswelter commented Aug 12, 2021

Use cases:

  1. User adds new project folder
    1. Create new project in the database
    2. Instantiate the project in memory
    3. If there are any original files in the directory, handle with the "new original file" process described below.
  2. User adds new original file to project folder
    1. Add file to the database unless it exists already
    2. Instantiate the original file in memory
    3. If the processed file does not exist, add the downsampling job to the downsampling task queue
    4. When downsampling is complete, file will be fully available in the UI
  3. User replaces original file
    1. Delete old processed file, if it exists
    2. Add the downsampling job to task the downsampling task queue
    3. When downsampling is complete, file will be fully available in the UI
  4. User deletes original file
    1. Try to delete the file in the database
      1. The delete query should fail if it has incoming foreign key references (e.g. from patterns or annotations). This is expected and desired behavior. If the file has these items, it will be left intact in the database. Otherwise, it will get deleted.
    2. Delete the file from memory
      1. If the file does not get deleted from the database, it should not appear in the UI (since it exists in the database but not on disk). Also see: Load project spec below.
    3. Delete the processed file, if it exists
  5. User adds processed file
    1. [ This use case is intentionally not handled. There is no good reason the administrator would do this other than rare edge cases. ]
  6. User replaces processed file.
    1. [ This use case is intentionally not handled. There is no good reason the administrator would do this other than rare edge cases. ]
  7. User deletes processed file
    1. [ This use case is intentionally not handled. There is no good reason the administrator would do this other than rare edge cases. ]
  8. While auviewer is not running, user replaces original file
    1. [ We plan to track last-modified-date of each file in the database as well as a hash. If last-mod-date changes, then we will re-compute hash and check. If hash has also changed, we will re-downsample & update last-mod-date & hash. If not, we will update last-mod-date only. ]
    2. Upon startup & detection, follow the same procedure as User replaces original file above.

Related functionality, to-be state:

  1. Load project (e.g. load project on viewer startup)
    1. Load files from database
    2. If original file does not exist on disk, skip/ignore it (it should not be loaded into memory and should not be listed in the UI)
    3. [We believe this is what is happening right now, but the spec is included for completeness.]
@guswelter
Copy link
Contributor Author

Just a note. This issue is paused for other work at the moment, but we plan to review this with an eye towards managing complexity when we're ready to take it on again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants