owncloud / owncloud/ocis

deleting space deletes notification related to the space except space deleted notification

Open
#10,941 2 comments 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 2h
Merged PRs (30d)
106

Description

## Describe the bug
admin creates a space and shares the space to marie. marie gets sharing and disabling notifications when listing.

```
curl -u marie:radioactivity -X GET "https://localhost:9200/ocs/v2.php/apps/notifications/api/v1/notifications?format=json" -vk
```

```json
{
"ocs": {
"meta": {
"message": "",
"status": "",
"statuscode": 200
},
"data": [
{
"notification_id": "a6bbc743-8ba7-4164-ae4d-705977c9acd2",
"app": "userlog",
"user": "admin",
"datetime": "2025-01-29T09:14:15.990933157+05:45",
"object_id": "cc537348-8405-462e-94e6-0304d9e8088d$2f633f78-f43a-4eb4-91d8-a03139382f17",
"object_type": "storagespace",
"subject": "Space shared",
"subjectRich": "Space shared",
"message": "Admin added you to Space a",
"messageRich": "{user} added you to Space {space}",
"messageRichParameters": {
"space": {
"id": "cc537348-8405-462e-94e6-0304d9e8088d$2f633f78-f43a-4eb4-91d8-a03139382f17!2f633f78-f43a-4eb4-91d8-a03139382f17",
"name": "a"
},
"user": {
"displayname": "Admin",
"id": "1fd5be0e-c6b8-43e5-8682-aa6a07dab275",
"name": "admin"
}
}
},
{
"notification_id": "6edcc70e-9198-4eb3-a1ba-0ce842af41e6",
"app": "userlog",
"user": "admin",
"datetime": "2025-01-29T09:14:21.368952709+05:45",
"object_id": "cc537348-8405-462e-94e6-0304d9e8088d$2f633f78-f43a-4eb4-91d8-a03139382f17",
"object_type": "storagespace",
"subject": "Space disabled",
"subjectRich": "Space disabled",
"message": "Admin disabled Space a",
"messageRich": "{user} disabled Space {space}",
"messageRichParameters": {
"space": {
"id": "cc537348-8405-462e-94e6-0304d9e8088d$2f633f78-f43a-4eb4-91d8-a03139382f17!2f633f78-f43a-4eb4-91d8-a03139382f17",
"name": "a"
},
"user": {
"displayname": "Admin",
"id": "1fd5be0e-c6b8-43e5-8682-aa6a07dab275",
"name": "admin"
}
}
}
]
}
}

```

if admin deletes the space only the space deleted notification is present and other notifications are deleted

```json
{
"ocs": {
"meta": {
"message": "",
"status": "",
"statuscode": 200
},
"data": [
{
"notification_id": "d2411b6e-d081-4814-829e-e5f16fe1be84",
"app": "userlog",
"user": "admin",
"datetime": "2025-01-29T09:18:24.148634111+05:45",
"object_id": "cc537348-8405-462e-94e6-0304d9e8088d$2f633f78-f43a-4eb4-91d8-a03139382f17",
"object_type": "storagespace",
"subject": "Space deleted",
"subjectRich": "Space deleted",
"message": "Admin deleted Space a",
"messageRich": "{user} deleted Space {space}",
"messageRichParameters": {
"space": {
"id": "cc537348-8405-462e-94e6-0304d9e8088d$2f633f78-f43a-4eb4-91d8-a03139382f17",
"name": "a"
},
"user": {
"displayname": "Admin",
"id": "1fd5be0e-c6b8-43e5-8682-aa6a07dab275",
"name": "admin"
}
}
}
]
}
}
```

## Steps to reproduce
1. create and share a space
2. disable the space
3. list the notifications

## Expected behavior
i don't know if this is the expected behavior.

## Actual behavior
A clear and concise description of what happened.

## Setup
Please describe how you started the server and provide a list of relevant environment variables or configuration files.

```console
ownCloud Web UI 11.1.2
Infinite Scale 7.1.0-rc.3+0a25063cd6 Community
```

## Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.