Skip to content
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

Flaky Inclusion of Share Expiration Notification in Grouped Emails #11001

Open
anon-pradip opened this issue Feb 13, 2025 · 0 comments
Open

Flaky Inclusion of Share Expiration Notification in Grouped Emails #11001

anon-pradip opened this issue Feb 13, 2025 · 0 comments
Labels

Comments

@anon-pradip
Copy link
Contributor

anon-pradip commented Feb 13, 2025

Describe the bug

There is an inconsistent behavior while delivering grouped email notifications concerning share expiration. Specifically, when multiple events occur, the daily summary email occasionally fails to include notifications for expired share, which might lead to unreliable communication.

Steps to reproduce

Note: Both in-app and email notifications are enabled for events: Share Received, Share Removed, Share Expired, Added as space member, Removed as space member. Space membership expired

  1. Brian enables "daily" as "Email sending interval" from My Account->Preferences->Notifications
  2. Alice creates a project space "share space", a folder "FolderToShare" and a file "lorem.txt" with any text content
  3. Alice shares "lorem.txt" to Brian with viewer role
  4. Alice removes the share "lorem.txt" shared with Katherine
  5. Alice shares "lorem.txt" to Brian with viewer role and
  6. Alice expires the share "lorem.txt" shared with Brian
  7. Alice shares the space "share space" to Brian
  8. Alice removes Brian from space "share space"
  9. Alice shares the space "share space" with Space Viewer role and
  10. Alice expires the space "share space"
  11. Trigger the CLI command for grouped email notification: notifications send-email --daily

Refs for more description of email cycles: #10793
Refs for the steps: e0ec69f

Expected behavior

Message related to the expiration of file "lorem.txt" should have been included after the message related to Alice sharing "lorem.txt" with ; somewhat like:

Your share to lorem.txt has expired at <expired-date>
Even though this share has been revoked you still might have access through other shares and/or space memberships.

Actual behavior

Message related to the expiration of file "lorem.txt" should always have been included after the message related to Alice sharing "lorem.txt" with ; somewhat like:

Your share to lorem.txt has expired at <expired-date>
Even though this share has been revoked you still might have access through other shares and/or space memberships.

For the above mentioned steps, the test ↓ sometime gets passed:

 Scenario: get daily grouped email notification via CLI command                                          # /drone/src/tests/acceptance/features/cliCommands/emailNotification.feature:11

    Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API       # GraphContext::theAdministratorHasGivenTheRoleUsingTheGraphApi()

    And user "Alice" has created a space "share space" with the default quota using the Graph API         # SpacesContext::theUserHasCreatedASpaceByDefaultUsingTheGraphApi()

    And user "Alice" has created folder "FolderToShare"                                                   # FeatureContext::userHasCreatedFolder()

    And user "Alice" has uploaded file with content "some data" to "lorem.txt"                            # FeatureContext::userHasUploadedAFileWithContentTo()

    And user "Brian" has enabled notification for the following events using the settings API:            # SettingsContext::userHasDisabledOrEnabledNotificationForFollowingEventUsingSettingsApi()

      | Email sending interval | daily |

    And using SharingNG                                                                                   # FeatureContext::usingSharingNG()

    And user "Alice" has sent the following resource share invitation:                                    # SharingNgContext::userHasSentTheFollowingResourceShareInvitation()

      | resource        | lorem.txt |

      | space           | Personal  |

      | sharee          | Brian     |

      | shareType       | user      |

      | permissionsRole | Viewer    |

    And user "Alice" has removed the access of user "Brian" from resource "lorem.txt" of space "Personal" # SharingNgContext::userHasRemovedAccessOfUserOrGroupFromResourceOfSpace()

    And user "Alice" has sent the following resource share invitation:                                    # SharingNgContext::userHasSentTheFollowingResourceShareInvitation()

      | resource           | lorem.txt                |

      | space              | Personal                 |

      | sharee             | Brian                    |

      | shareType          | user                     |

      | permissionsRole    | Viewer                   |

      | expirationDateTime | 2042-01-01T23:59:59.000Z |

    And user "Alice" has expired the last share of resource "lorem.txt" inside of the space "Personal"    # SpacesContext::userHasExpiredTheLastShareOfResourceInsideOfTheSpace()

    And using spaces DAV path                                                                             # FeatureContext::usingOldOrNewOrSpacesDavPath()

    And user "Alice" has sent the following space share invitation:                                       # SharingNgContext::userHasSentTheFollowingShareShareInvitation()

      | space           | share space  |

      | sharee          | Brian        |

      | shareType       | user         |

      | permissionsRole | Space Viewer |

    And user "Alice" has removed the access of user "Brian" from space "share space"                      # SharingNgContext::userHasRemovedAccessOfUserOrGroupFromSpace()

    And user "Alice" has sent the following space share invitation:                                       # SharingNgContext::userHasSentTheFollowingShareShareInvitation()

      | space              | share space              |

      | sharee             | Brian                    |

      | shareType          | user                     |

      | permissionsRole    | Space Viewer             |

      | expirationDateTime | 2042-03-25T23:59:59.000Z |

    And user "Alice" has updated the space "share space" with settings:                                   # SpacesContext::userHasUpdatedTheSpaceWithSettings()

      | shareWith  | Brian                         |

      | expireDate | 2024-01-01T23:59:59.999+01:00 |

    When the administrator triggers "daily" email notifications using the CLI                             # CliContext::theAdministratorTriggersEmailNotificationsUsingTheCLI()

    Then the command should be successful                                                                 # CliContext::theCommandShouldBeSuccessful()

    And the command output should contain "successfully sent SendEmailsEvent"                             # CliContext::theCommandOutputShouldContain()

    And user "Brian" should have received the following email from user "Alice"                           # NotificationContext::userShouldHaveReceivedTheFollowingEmailFromUser()

      """

      Hi Brian Murphy,

      

      Alice Hansen has shared "lorem.txt" with you.

      

      

      Alice Hansen has unshared 'lorem.txt' with you.

      

      Even though this share has been revoked you still might have access through other shares and/or space memberships.

      

      

      Alice Hansen has shared "lorem.txt" with you.

      

      

      Alice Hansen has invited you to join "share space".

      

      

      Alice Hansen has removed you from "share space".

      

      You might still have access through your other groups or direct membership.

      

      

      Alice Hansen has invited you to join "share space".

      

      

      Your membership of space share space has expired at 2024-01-01 22:59:59

      

      Even though this membership has expired you still might have access through other shares and/or space memberships

      """

      │ [INFO] Mailbox is empty...

Passing build:
https://drone.owncloud.com/owncloud/ocis/43324/50/9,
https://drone.owncloud.com/owncloud/ocis/43291/15/9

But sometime for the same above mentioned steps, it yells with the inclusion of message related to expiration of the file "lorem.txt", making the test fail:

  Scenario: get daily grouped email notification via CLI command                                          # /drone/src/tests/acceptance/features/cliCommands/emailNotification.feature:11

    Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API       # GraphContext::theAdministratorHasGivenTheRoleUsingTheGraphApi()

    And user "Alice" has created a space "share space" with the default quota using the Graph API         # SpacesContext::theUserHasCreatedASpaceByDefaultUsingTheGraphApi()

    And user "Alice" has created folder "FolderToShare"                                                   # FeatureContext::userHasCreatedFolder()

    And user "Alice" has uploaded file with content "some data" to "lorem.txt"                            # FeatureContext::userHasUploadedAFileWithContentTo()

    And user "Brian" has enabled notification for the following events using the settings API:            # SettingsContext::userHasDisabledOrEnabledNotificationForFollowingEventUsingSettingsApi()

      | Email sending interval | daily |

    And using SharingNG                                                                                   # FeatureContext::usingSharingNG()

    And user "Alice" has sent the following resource share invitation:                                    # SharingNgContext::userHasSentTheFollowingResourceShareInvitation()

      | resource        | lorem.txt |

      | space           | Personal  |

      | sharee          | Brian     |

      | shareType       | user      |

      | permissionsRole | Viewer    |

    And user "Alice" has removed the access of user "Brian" from resource "lorem.txt" of space "Personal" # SharingNgContext::userHasRemovedAccessOfUserOrGroupFromResourceOfSpace()

    And user "Alice" has sent the following resource share invitation:                                    # SharingNgContext::userHasSentTheFollowingResourceShareInvitation()

      | resource           | lorem.txt                |

      | space              | Personal                 |

      | sharee             | Brian                    |

      | shareType          | user                     |

      | permissionsRole    | Viewer                   |

      | expirationDateTime | 2042-01-01T23:59:59.000Z |

    And user "Alice" has expired the last share of resource "lorem.txt" inside of the space "Personal"    # SpacesContext::userHasExpiredTheLastShareOfResourceInsideOfTheSpace()

    And using spaces DAV path                                                                             # FeatureContext::usingOldOrNewOrSpacesDavPath()

    And user "Alice" has sent the following space share invitation:                                       # SharingNgContext::userHasSentTheFollowingShareShareInvitation()

      | space           | share space  |

      | sharee          | Brian        |

      | shareType       | user         |

      | permissionsRole | Space Viewer |

    And user "Alice" has removed the access of user "Brian" from space "share space"                      # SharingNgContext::userHasRemovedAccessOfUserOrGroupFromSpace()

    And user "Alice" has sent the following space share invitation:                                       # SharingNgContext::userHasSentTheFollowingShareShareInvitation()

      | space              | share space              |

      | sharee             | Brian                    |

      | shareType          | user                     |

      | permissionsRole    | Space Viewer             |

      | expirationDateTime | 2042-03-25T23:59:59.000Z |

    And user "Alice" has updated the space "share space" with settings:                                   # SpacesContext::userHasUpdatedTheSpaceWithSettings()

      | shareWith  | Brian                         |

      | expireDate | 2024-01-01T23:59:59.999+01:00 |

    When the administrator triggers "daily" email notifications using the CLI                             # CliContext::theAdministratorTriggersEmailNotificationsUsingTheCLI()

    Then the command should be successful                                                                 # CliContext::theCommandShouldBeSuccessful()

    And the command output should contain "successfully sent SendEmailsEvent"                             # CliContext::theCommandOutputShouldContain()

    And user "Brian" should have received the following email from user "Alice"                           # NotificationContext::userShouldHaveReceivedTheFollowingEmailFromUser()

      """

      Hi Brian Murphy,

      

      Alice Hansen has shared "lorem.txt" with you.

      

      

      Alice Hansen has unshared 'lorem.txt' with you.

      

      Even though this share has been revoked you still might have access through other shares and/or space memberships.

      

      

      Alice Hansen has shared "lorem.txt" with you.

      

      

      Alice Hansen has invited you to join "share space".

      

      

      Alice Hansen has removed you from "share space".

      

      You might still have access through your other groups or direct membership.

      

      

      Alice Hansen has invited you to join "share space".

      

      

      Your membership of space share space has expired at 2024-01-01 22:59:59

      

      Even though this membership has expired you still might have access through other shares and/or space memberships

      """

      │ [INFO] Mailbox is empty...



      The email address '[email protected]' should have received an email with the body containing Hi Brian Murphy,

      

      Alice Hansen has shared "lorem.txt" with you.

      

      

      Alice Hansen has unshared 'lorem.txt' with you.

      

      Even though this share has been revoked you still might have access through other shares and/or space memberships.

      

      

      Alice Hansen has shared "lorem.txt" with you.

      

      

      Alice Hansen has invited you to join "share space".

      

      

      Alice Hansen has removed you from "share space".

      

      You might still have access through your other groups or direct membership.

      

      

      Alice Hansen has invited you to join "share space".

      

      

      Your membership of space share space has expired at 2024-01-01 22:59:59

      

      Even though this membership has expired you still might have access through other shares and/or space memberships

      			but the received email is Hi Brian Murphy,

      

      Alice Hansen has shared "lorem.txt" with you.

      

      

      Alice Hansen has unshared 'lorem.txt' with you.

      

      Even though this share has been revoked you still might have access through other shares and/or space memberships.

      

      

      Alice Hansen has shared "lorem.txt" with you.

      

      

      Your membership of space Alice Hansen has expired at 2025-02-09 00:00:00

      

      Even though this membership has expired you still might have access through other shares and/or space memberships

      

      

      Alice Hansen has invited you to join "share space".

      

      

      Alice Hansen has removed you from "share space".

      

      You might still have access through your other groups or direct membership.

      

      

      Alice Hansen has invited you to join "share space".

      

      

      Your membership of space share space has expired at 2024-01-01 22:59:59

      

      Even though this membership has expired you still might have access through other shares and/or space memberships

      

      

      ---

      ownCloud - Store. Share. Work.

      https://owncloud.com

Failing build:
https://drone.owncloud.com/owncloud/ocis/43283/15/9,
https://drone.owncloud.com/owncloud/ocis/43340/50/9

Request log:

==> REQUEST

		GET /api/v1/mailbox/brian/20250210T041714-0001

		X-Request-ID: cliCommands/emailNotification.feature:11-53


		<== RESPONSE

		200 OK

		Transfer-Encoding: chunked

		<== RES BODY

		{"mailbox":"brian","id":"20250210T041714-0001","from":"\"ownCloud\" \[email protected]\u003e via ownCloud \[email protected]\u003e","to":["\[email protected]\u003e"],"subject":"Report","date":"2025-02-10T04:17:14.42311313Z","posix-millis":1739161034423,"size":4090,"seen":false,"body":{"text":"Hi Brian Murphy,\n\nAlice Hansen has shared \"lorem.txt\" with you.\n\n\nAlice Hansen has unshared 'lorem.txt' with you.\n\nEven though this share has been revoked you still might have access through other shares and/or space memberships.\n\n\nAlice Hansen has shared \"lorem.txt\" with you.\n\n\nYour membership of space Alice Hansen has expired at 2025-02-09 00:00:00\n\nEven though this membership has expired you still might have access through other shares and/or space memberships\n\n\nAlice Hansen has invited you to join \"share space\".\n\n\nAlice Hansen has removed you from \"share space\".\n\nYou might still have access through your other groups or direct membership.\n\n\nAlice Hansen has invited you to join \"share space\".\n\n\nYour membership of space share space has expired at 2024-01-01 22:59:59\n\nEven though this membership has expired you still might have access through other shares and/or space memberships\n\n\n---\nownCloud - Store. Share. Work.\nhttps://owncloud.com\n","html":"\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003cbody\u003e\n\u003ctable cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\"\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ctable cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"600px\"\u003e\n                \u003ctr\u003e\n                    \u003ctd width=\"20px\"\u003e\u0026nbsp;\u003c/td\u003e\n                    \u003ctd style=\"font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;\"\u003e\n                        Hi Brian Murphy,\n                        \u003cbr\u003e\u003cbr\u003e\n                        Alice Hansen has shared \"lorem.txt\" with you.\u003cbr\u003e\u003cbr\u003e\u003cbr\u003eAlice Hansen has unshared 'lorem.txt' with you.\u003cbr\u003e\u003cbr\u003eEven though this share has been revoked you still might have access through other shares and/or space memberships.\u003cbr\u003e\u003cbr\u003e\u003cbr\u003eAlice Hansen has shared \"lorem.txt\" with you.\u003cbr\u003e\u003cbr\u003e\u003cbr\u003eYour membership of space Alice Hansen has expired at 2025-02-09 00:00:00\u003cbr\u003e\u003cbr\u003eEven though this membership has expired you still might have access through other shares and/or space memberships\u003cbr\u003e\u003cbr\u003e\u003cbr\u003eAlice Hansen has invited you to join \"share space\".\u003cbr\u003e\u003cbr\u003e\u003cbr\u003eAlice Hansen has removed you from \"share space\".\u003cbr\u003e\u003cbr\u003eYou might still have access through your other groups or direct membership.\u003cbr\u003e\u003cbr\u003e\u003cbr\u003eAlice Hansen has invited you to join \"share space\".\u003cbr\u003e\u003cbr\u003e\u003cbr\u003eYour membership of space share space has expired at 2024-01-01 22:59:59\u003cbr\u003e\u003cbr\u003eEven though this membership has expired you still might have access through other shares and/or space memberships\n                    \u003c/td\u003e\n                \u003c/tr\u003e\n                \u003ctr\u003e\n                    \u003ctd colspan=\"2\"\u003e\u0026nbsp;\u003c/td\u003e\n                \u003c/tr\u003e\n                \u003ctr\u003e\n                    \u003ctd width=\"20px\"\u003e\u0026nbsp;\u003c/td\u003e\n                    \u003ctd style=\"font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;\"\u003e\n                        \u003cfooter\u003e\n                            \u003cbr\u003e\n                            \u003cbr\u003e\n                            --- \u003cbr\u003e\n                            ownCloud - Store. Share. Work.\u003cbr\u003e\n                            \u003ca href=\"https://owncloud.com\"\u003ehttps://owncloud.com\u003c/a\u003e\n                        \u003c/footer\u003e\n                    \u003c/td\u003e\n                \u003c/tr\u003e\n                \u003ctr\u003e\n                    \u003ctd colspan=\"2\"\u003e\u0026nbsp;\u003c/td\u003e\n                \u003c/tr\u003e\n            \u003c/table\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n"},"header":{"Content-Type":["multipart/alternative; boundary=8ce25b763862391f6689040d8e270d3a40c2d40b268d3ba2359e6e9908db"],"Date":["Mon, 10 Feb 2025 04:17:14 +0000"],"From":["\"\\\"ownCloud\\\" \[email protected]\u003e via ownCloud\" \[email protected]\u003e"],"Mime-Version":["1.0"],"Received":["from localhost ([172.25.1.3]) by inbucket for \[email protected]\u003e; Mon, 10 Feb 2025 04:17:14 +0000 (UTC)"],"Subject":["Report"],"To":["\[email protected]\u003e"]},"attachments":[]}
@anon-pradip anon-pradip changed the title Flaky Inclusion of Share Expiration Notifications in Grouped Emails Flaky Inclusion of Share Expiration Notification in Grouped Emails Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant