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

Only in case of $currentAccess the array uses the user id as index #7327

Merged

Conversation

nickvergessen
Copy link
Member

Regression from 3820d68

Before 3820d68 the method worked for !$currentAccess, afterwards for $currentAccess, now it works for both and I added the relevant unit tests before.

Fix #7325

Signed-off-by: Joas Schilling <coding@schilljs.com>
Otherwise its a normal string[] with the user ids, in that
case the array_merge did it's job just fine, apart from it
not being deduplicated.
The array+array is only needed when the user id is the key,
so integer only user ids are kept as they are instead of being
reindexed.

Regression from 3820d68

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen added 3. to review Waiting for reviews bug labels Nov 28, 2017
@nickvergessen nickvergessen added this to the Nextcloud 13 milestone Nov 28, 2017
@@ -3021,7 +3132,7 @@ public function testGetAccessList() {

$this->assertSame($expected['public'], $result['public']);
$this->assertSame($expected['remote'], $result['remote']);
$this->assertSame(array_values($expected['users']), array_values($result['users']));
Copy link
Member Author

@nickvergessen nickvergessen Nov 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hide the integer user id problem before, because we didn't even look at the user id (key) anymore

Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good and fixes the regression

@blizzz blizzz merged commit 0597cca into master Nov 28, 2017
@blizzz blizzz deleted the bugfix/7325/access-list-regression-for-not-current-accesss branch November 28, 2017 16:57
@codecov
Copy link

codecov bot commented Nov 28, 2017

Codecov Report

Merging #7327 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##             master    #7327      +/-   ##
============================================
+ Coverage     50.86%   50.86%   +<.01%     
- Complexity    24538    24539       +1     
============================================
  Files          1584     1584              
  Lines         93794    93798       +4     
  Branches       1358     1358              
============================================
+ Hits          47705    47709       +4     
  Misses        46089    46089
Impacted Files Coverage Δ Complexity Δ
lib/private/Share20/Manager.php 86.64% <100%> (+0.08%) 236 <0> (+1) ⬆️
apps/files_trashbin/lib/Expiration.php 90.32% <0%> (-1.62%) 29% <0%> (ø)
lib/private/Server.php 82.62% <0%> (-0.12%) 126% <0%> (ø)
apps/files_trashbin/lib/Trashbin.php 72.53% <0%> (+0.24%) 136% <0%> (ø) ⬇️
lib/private/Security/CertificateManager.php 92.07% <0%> (+0.99%) 39% <0%> (ø) ⬇️

@MorrisJobke
Copy link
Member

@nickvergessen could you create the backport PR?

@nickvergessen
Copy link
Member Author

One should be enough?
I did that right away #7328

@MorrisJobke
Copy link
Member

One should be enough?
I did that right away #7328

Was not shown on mobile view :/ Sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants