File Version Control
Alchez opened this issue · 0 comments
Alchez commented
Goal: Allow version control of files using Frappe and a cloud storage platform
Variables:
- File Name: non-unique name assigned to a file object
- Content Hash: unique content identifier for the file object
Flows
1. New filename, new hash
- User uploads a file
- Client makes a call to Frappe server to validate duplicate name and/or hash
- No file with filename or hash exists
- Continue file upload process and store in cloud platform
- Retrieve (if not available in response) and store the file's version ID (if applicable)
2. Existing filename, new hash
- User uploads a file
- Client makes a call to Frappe server to validate duplicate name and/or hash
- A file with the same filename is found, but with different hash
- Ask user for an input (create new file with new name, or override existing file and add version):
- If new file:
- Continue file upload process and store in cloud platform
- Retrieve (if not available in response) and store the file's version ID (if applicable)
- If override:
- Continue file upload process and override the file object in the cloud platform
- Retrieve (if not available in response) and store the file's new version ID (if applicable)
3&4. New/existing filename, existing hash
- User uploads a file
- Client makes a call to Frappe server to validate duplicate name and/or hash
- A file with the same unique hash is found, with the same or different file name
- Stop file upload process and show a link to the existing file
5. Rename file
- User clicks on "Rename" on a File record via the UI
- Client makes a call to Frappe server to validate duplicate name
- If new filename is available:
- Continue rename process and change name on cloud platform
- Retrieve (if not available in response) and store the file's new version ID (if applicable)
- If new filename exists:
- Ask user for an input (new filename)
- Continue rename process and change name on cloud platform
- Retrieve (if not available in response) and store the file's new version ID (if applicable)