Skip to content

[Bug]: Shares reminder triggered even though the recipient has already uploaded files #64871

Description

@ElSi-DVT

⚠️ This issue respects the following points: ⚠️

  • This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
  • This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
  • I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
  • I agree to follow Nextcloud's Code of Conduct.
  • I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.

Bug description

The share reminders function added in 5e4a166 and d633b9b is quite practical so far, but we recently encountered a bug:

If files are uploaded to a folder shared internally or via email sharing, but then moved elsewhere by the person who created the share, the share recipient incorrectly receives a reminder, even though they have already correctly uploaded data. This leads to confusion.

Steps to reproduce

  1. Create an external email share or internal share with an expiration date for an empty folder with write permissions.
  2. As the share recipient, upload files to the folder via the share.
  3. The share creator moves the uploaded files to another folder, leaving the shared folder empty again.
  4. 24 hours before the set expiration date, the share recipient receives a reminder email.

Expected behavior

These are the conditions under which SharesReminderJob.php sends a reminder email:

  • The share must have been made either to an internal user (TYPE_USER) or via email (TYPE_EMAIL).
  • It must be a folder.
  • The recipient must have write permissions (specifically: PERMISSION_CREATE) to upload files.
  • Expiration date:
    • The share must have a set expiration date.
    • This expiration date must be within the next 24 hours (defined by SECONDS_BEFORE_REMINDER = 24 * 60 * 60).
    • The date must not be in the past.
  • The shared folder must be empty. The job checks whether there are already files in that folder. If it is empty, the reminder is triggered.
  • The field reminder_sent in the database must be false. Once the email has been sent (or prepared for sending), this field is set to true to prevent duplicate emails.

As soon as files are uploaded by the share recipient, the field reminder_sent should be set to true or an additional condition should be added: if the share recipient has ever uploaded files before, the email should also not be sent.

Nextcloud Server version

35

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmap35-feedbackbug

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions