X Tutup
Skip to content

[10.11] Show users only once when repeated for batch sharing#40347

Merged
phil-davis merged 1 commit intorelease-10.11.0from
fix-batch-user-matching
Sep 8, 2022
Merged

[10.11] Show users only once when repeated for batch sharing#40347
phil-davis merged 1 commit intorelease-10.11.0from
fix-batch-user-matching

Conversation

@phil-davis
Copy link
Contributor

@phil-davis phil-davis commented Sep 8, 2022

Description

If users for batch sharing are listed in a comma-separated list with varying amounts of white-space after the commas, then the usernames can be repeated in the suggested list to add - even though they are the same user.

Enter: brian,carol, brian, carol and all 4 "users" are suggested.

This PR fixes the problem by removing and white-space after commas in the list of users, before splitting the list into and array.

Note: the fixes only does this when generating the list of unique users. This must not be done generally to the string before this point, because group names can have white-space in them. For example, we still need to be able to share with a group called brian, carol ! And a different group called brian,carol ! So space matters for group names.

Related Issue

How Has This Been Tested?

I manually tried some combinations with 2 users like bbbband cccc and having groups called bbbb,cccc and bbbb, cccc. I can share with the 2 users, or either group (depending on if I type the space or not after the comma)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@phil-davis phil-davis force-pushed the fix-batch-user-matching branch from f9a9854 to 21d3ec9 Compare September 8, 2022 09:04
@owncloud owncloud deleted a comment from ownclouders Sep 8, 2022
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 8, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@owncloud owncloud deleted a comment from ownclouders Sep 8, 2022
@phil-davis phil-davis merged commit a368add into release-10.11.0 Sep 8, 2022
@delete-merged-branch delete-merged-branch bot deleted the fix-batch-user-matching branch September 8, 2022 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup