feat(files_sharing): reminder for link shares with expiration date
- Resolves: #45676
Summary
This pull request implements the feature as described in the associated issue. A cron job runs hourly to check if any empty folders have less than a day remaining before their expiration date. The feature supports two types of shares: user shares and email shares.
Additionally, a migration was added to include a 'reminder sent' flag, ensuring that reminders are neither skipped nor sent multiple times when the job runs at irregular intervals, especially when using webcron or ajax instead of cron.
This solution can be easily extended to send reminders for link shares without an expiration date (e.g. after 4 days), if the maintainers choose to implement this feature.
Checklist
- Code is properly formatted
- Sign-off message is added to all commits
- [x] Tests (unit, integration, api and/or acceptance) are included
- [x] Screenshots before/after for front-end changes
- [ ] Documentation (manuals or wiki) has been updated or is not required
- [ ] Backports requested where applicable (ex: critical bugfixes)
Great idea @Luka-sama !! Take your time to address Come's comments :+1:
Thank you @come-nc and @skjnldsv! The idea comes from the issue, but I found it a very interesting task to implement it here :) That's a very nice idea with generators! I will fix/address this and other problems in the next days.
So, I've fixed the problems that @come-nc found! To do this, I moved the condition checking (write permissions and folder emptiness) to the database query - to avoid the situation where the job checks the same 1000 shares every time.
Thank you for your code review! Yes, currently only two types of shares are supported (both in providers and in the job itself). However, support for other types can easily be added if needed.
You're right, that's definitely a good idea for the future to make the feature more universal this way.
Thanks!
Ok, let's go! :rocket:
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22
This broke CI on master cc @skjnldsv
Hello there, Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.
We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.
Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6
Thank you for contributing to Nextcloud and we hope to hear from you soon!
(If you believe you should not receive this message, you can add yourself to the blocklist.)