passbolt_api icon indicating copy to clipboard operation
passbolt_api copied to clipboard

Folder Filter Returning Duplicate Resources

Open Paulo1402 opened this issue 1 year ago • 4 comments

Folder Filter Returning Duplicate Resources

Passbolt Version: 4.9.1 Platform and Target: -- Operating system: Ubuntu 20.04.6 LTS -- PHP: 7.4.3-4ubuntu2.24 -- Web server: Nginx 1.18.0 -- Database server: MySQL 15.1

What you did

When I fetch /resources.json with the has-parent filter, it returns a lot of duplicate entries.

Request example: GET https://base_url/resources.json?filter%5Bhas-parent%5D=3dda7223-35a4-4010-b86f-d2a0530e3ddf

What happened

The filter correctly returns only the resources within the folder, but each resource is returned multiple times. It seems the results are multiplied by the number of users who can access that resource. For example, if I have 40 resources in a folder and share it with a group of 8 members, using the has-parent filter returns 320 resources, with each resource duplicated 8 times.

image

image

image

I noticed that if a folder is shared with more than one group and there is a user who is in both groups, the entry will only return once for that user.

What you expected to happen

I expected the result to include only the resources within the folder, with each entry being returned once.

Paulo1402 avatar Oct 15 '24 13:10 Paulo1402

Thank @Paulo1402 we'll have a look (PB-35980) For the avoidance of doubt can make sure you make sure the data is clean:

sudo su -s /bin/bash -c './bin/cake passbolt cleanup' www-data
sudo su -s /bin/bash -c './bin/cake passbolt datacheck' www-data

stripthis avatar Oct 15 '24 13:10 stripthis

Thank @Paulo1402 we'll have a look (PB-35980) For the avoidance of doubt can make sure you make sure the data is clean:

sudo su -s /bin/bash -c './bin/cake passbolt cleanup' www-data
sudo su -s /bin/bash -c './bin/cake passbolt datacheck' www-data

Of course! I just ran these commands and didn't see anything wrong, all the data seems to be fine.

Paulo1402 avatar Oct 16 '24 13:10 Paulo1402

Hey @Paulo1402, we are able to reproduce the issue and working on the fix. We will update you once it gets released (ideally with v4.10).

ishanvyas22 avatar Oct 17 '24 09:10 ishanvyas22

Hey @Paulo1402, we are able to reproduce the issue and working on the fix. We will update you once it gets released (ideally with v4.10).

Thank you @ishanvyas22! I will be waiting for you guys!

Paulo1402 avatar Oct 17 '24 10:10 Paulo1402

Hey @Paulo1402, the fix for this issue has been released with v4.10.0 release. Closing the issue for now, feel free to reopen if issue persist.

Thank you for your patience.

ishanvyas22 avatar Nov 20 '24 13:11 ishanvyas22