-
Notifications
You must be signed in to change notification settings - Fork 58
fix: ignore deleted files in submissions #457
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
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, @samuelallan72! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
If a file is deleted from disk somehow after the student response has been submitted, the api will still respond with metadata about these files. However, the download url will be empty, resulting in broken files in the frontend ui: the preview pane will display an "Unknown error", and downloading the files will result in downloaded files with the correct file names but invalid content. The student view in ORA handles these deleted files by simply ignoring them and not displaying them to the user. So here we do the same: simply filter out any deleted files from the api. Private-ref: https://tasks.opencraft.com/browse/BB-9781
412c428
to
73ad359
Compare
Hi @samuelallan72 - thank you for this contribution! Please let me know if you have any questions regarding submitting a CLA form. Thanks! |
@samuelallan72 Your branch is behind the base. I've pulled in changes from master as a merge commit which will update your branch and cause the tests to be re-run. |
@samuelallan72 I notice there are some failed checks on this PR, can you have a look? |
Thanks @e0d , I'm holding off on this PR for now (leaving it in draft). I'm working on #2319 to try to avoid the issue happening at the source. I'm not sure if this fix will still be required after the other is implemented. :) |
Description
If a file is deleted from disk somehow after the student response has been submitted, the api will still respond with metadata about these files. However, the download url will be empty, resulting in broken files in the frontend ui: the preview pane will display an "Unknown error", and downloading the files will result in downloaded files with the correct file names but invalid content.
The student view in ORA handles these deleted files by simply ignoring them and not displaying them to the user. So here we do the same: simply filter out any deleted files from the api.
Screenshots of the UI before:
and after:
Supporting information
none
Testing instructions
Without this patch:
With this patch:
Deadline
None
Other information
This is a minor frontend change only, so it shouldn't affect backwards compatibility.
The behaviour change is also in line with how the ORA block works already for the existing views.
Private-ref: https://tasks.opencraft.com/browse/BB-9781