fix: regenerate the cache on due date extensions
Description
When an individual extension is created through the Instructor Dashboard -> Extensions, the change is not immediately visible for students because edx-when caches it. This makes the following scenario possible:
- An instructor resets the user's due date for a timed exam to revoke their extension.
- The user is seeing a cached date, so they can still complete this exam until the cache expires.
- The instructor is not aware of this scenario, because the Instructor Dashboard is using a different mechanism for listing course extensions. This creates an inconsistency between what the student and instructor are seeing.
This removes such a possibility by manually regenerating the cache after changing individual due dates.
Testing instructions
- Set up a timed exam in a course. Set its due date to the past.
- Sign in (in a separate browser) as an audit user and try to access the exam.
- Go to the Instructor Dashboard -> Extensions, and add a due date extension for this user. If you do this point without the change from this PR, you should not be able to access the exam as an audit (for some time). With this change, it should work immediately
Author's notes
I was thinking about the best place for this invalidation, and excluded the following possibilities:
- Adding it directly to set_date_for_block (in
edx-when). While this seems to be the most intuitive place to handle cache invalidation, it could significantly impact the performance of setting dates for the whole course. - Using non-cached data in edx-proctoring - not really an option, since this would impact the performance of courses with proctored/timed exams.
Other information
Private-ref: BB-6658
Thanks for the pull request, @Agrendalath!
As a core committer in this repo, you can merge this once the pull request is approved per the core committer reviewer requirements and according to the agreement with your edX Champion.
:+1:
- [x] I tested this: followed the instructions in the PR
- [x] I read through the code
- [-] I checked for accessibility issues
- [x] Includes documentation
@Agrendalath Thank you for the contribution.
@natabene, this is ready for your review.
📣 💥 Heads-up: You must either rebase onto master or merge master into your branch to keep passing required checks.
We added a new required check, "Tests Successful," that this PR does not yet run. Rebasing will get it started.
If you have any questions, please reach out to the Architecture team (either #architecture on Open edX Slack or #external-architecture on edX internal Slack).
@Agrendalath 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.
EdX Release Notice: This PR has been deployed to the production environment.