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

[PB-35980] Folder Filter Returning Duplicate Resources #523

Closed
Paulo1402 opened this issue Oct 15, 2024 · 5 comments
Closed

[PB-35980] Folder Filter Returning Duplicate Resources #523

Paulo1402 opened this issue Oct 15, 2024 · 5 comments
Assignees
Labels

Comments

@Paulo1402
Copy link

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.

@stripthis
Copy link
Member

stripthis commented Oct 15, 2024

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

@Paulo1402
Copy link
Author

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.

@ishanvyas22
Copy link
Member

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).

@Paulo1402
Copy link
Author

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!

@cedricalfonsi cedricalfonsi changed the title Folder Filter Returning Duplicate Resources [PB-35980] Folder Filter Returning Duplicate Resources Oct 25, 2024
pull bot pushed a commit to l3dlp-sandbox/passbolt_api that referenced this issue Nov 20, 2024
pull bot pushed a commit to l3dlp-sandbox/passbolt_api that referenced this issue Nov 20, 2024
…licate-Resources-523' into 'common'

PB-35980 Fix has-parent filter returning duplicate resources (GITHUB passbolt#523)

See merge request passbolt/passbolt-pro-api!1821
@ishanvyas22
Copy link
Member

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.

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

3 participants