mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-12-05 22:46:09 -05:00
The provider of a federated sharer comes from the remote instance and we put it into messageRich ourselves, which web renders as HTML. We now only name it if it is a plain hostname. Otherwise the notification says "Someone shared ... with you". Looking up the federated sharer now has a timeout of 5 seconds, logs why it failed and caches failed lookups as well, so a hanging invite manager no longer blocks GET /notifications and a deleted federated connection costs one lookup per request instead of one per notification. The acceptance scenario for the disabled "Share Removed" setting now waits for the notification of a second share sent after the unshare before it checks that the unshare notification did not show up. Before, it checked once right after the 204 and passed even if the setting was ignored. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
81 lines
4.0 KiB
Gherkin
81 lines
4.0 KiB
Gherkin
@ocm
|
|
Feature: federated users get in-app notifications about shares
|
|
As a federated user
|
|
I want to be notified when a user of another instance shares a resource with me or removes the share
|
|
So that I know which federated resources I have access to
|
|
|
|
Background:
|
|
Given user "Alice" has been created with default attributes
|
|
And using server "REMOTE"
|
|
And user "Brian" has been created with default attributes
|
|
And "Brian" has created the federation share invitation
|
|
And using server "LOCAL"
|
|
And "Alice" has accepted invitation
|
|
And user "Alice" has created folder "folderToShare"
|
|
|
|
|
|
Scenario: federated user gets a notification when a resource is shared
|
|
When user "Alice" sends the following resource share invitation to federated user using the Graph API:
|
|
| resource | folderToShare |
|
|
| space | Personal |
|
|
| sharee | Brian |
|
|
| shareType | user |
|
|
| permissionsRole | Viewer |
|
|
Then the HTTP status code should be "200"
|
|
And using server "REMOTE"
|
|
And user "Brian" should get a notification with subject "Resource shared" and message:
|
|
| message |
|
|
| Alice Hansen shared folderToShare with you |
|
|
|
|
|
|
Scenario: federated user gets a notification when a share is removed
|
|
Given user "Alice" has sent the following resource share invitation to federated user:
|
|
| resource | folderToShare |
|
|
| space | Personal |
|
|
| sharee | Brian |
|
|
| shareType | user |
|
|
| permissionsRole | Viewer |
|
|
When user "Alice" removes the access of user "Brian" from resource "folderToShare" of space "Personal" using the Graph API
|
|
Then the HTTP status code should be "204"
|
|
And using server "REMOTE"
|
|
And user "Brian" should get a notification with subject "Resource unshared" and message:
|
|
| message |
|
|
| Alice Hansen unshared folderToShare with you |
|
|
|
|
|
|
Scenario: federated user does not get a notification for a removed share when the in-app notification is disabled
|
|
Given using server "REMOTE"
|
|
And user "Brian" has disabled notification for the following event using the settings API:
|
|
| event | Share Removed |
|
|
| notificationTypes | in-app |
|
|
And using server "LOCAL"
|
|
And user "Alice" has created folder "anotherFolder"
|
|
And user "Alice" has sent the following resource share invitation to federated user:
|
|
| resource | folderToShare |
|
|
| space | Personal |
|
|
| sharee | Brian |
|
|
| shareType | user |
|
|
| permissionsRole | Viewer |
|
|
And using server "REMOTE"
|
|
And user "Brian" should get a notification with subject "Resource shared" and message:
|
|
| message |
|
|
| Alice Hansen shared folderToShare with you |
|
|
And user "Brian" has deleted all notifications
|
|
And using server "LOCAL"
|
|
When user "Alice" removes the access of user "Brian" from resource "folderToShare" of space "Personal" using the Graph API
|
|
Then the HTTP status code should be "204"
|
|
# the share of anotherFolder reaches userlog after the unshare, so waiting for its notification
|
|
# gives the unshare the time to show up if the setting were ignored
|
|
When user "Alice" sends the following resource share invitation to federated user using the Graph API:
|
|
| resource | anotherFolder |
|
|
| space | Personal |
|
|
| sharee | Brian |
|
|
| shareType | user |
|
|
| permissionsRole | Viewer |
|
|
Then the HTTP status code should be "200"
|
|
And using server "REMOTE"
|
|
And user "Brian" should get a notification with subject "Resource shared" and message:
|
|
| message |
|
|
| Alice Hansen shared anotherFolder with you |
|
|
But user "Brian" should not have a notification related to resource "folderToShare" with subject "Resource unshared"
|