server icon indicating copy to clipboard operation
server copied to clipboard

feat(files_sharing): reminder for link shares with expiration date

Open Luka-sama opened this issue 1 year ago • 3 comments

  • 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.

grafik

Checklist

Luka-sama avatar Aug 22 '24 07:08 Luka-sama

Great idea @Luka-sama !! Take your time to address Come's comments :+1:

skjnldsv avatar Aug 22 '24 10:08 skjnldsv

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.

Luka-sama avatar Aug 22 '24 14:08 Luka-sama

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.

Luka-sama avatar Aug 27 '24 07:08 Luka-sama

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.

Luka-sama avatar Sep 02 '24 13:09 Luka-sama

You're right, that's definitely a good idea for the future to make the feature more universal this way.

Thanks!

Luka-sama avatar Sep 02 '24 20:09 Luka-sama

Ok, let's go! :rocket:

skjnldsv avatar Sep 03 '24 11:09 skjnldsv

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

welcome[bot] avatar Sep 03 '24 15:09 welcome[bot]

This broke CI on master cc @skjnldsv

Pytal avatar Sep 03 '24 18:09 Pytal

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.)

github-actions[bot] avatar Sep 06 '24 01:09 github-actions[bot]