-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix OCS Share API response for requests contain "include_tags" parameter #37088
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
|
||
foreach ($filesById as $key => $fileWithTags) { | ||
foreach ($fileList as $key2 => $file) { | ||
if ($file[$fileIdentifier] == $key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't remember the reason for such complex code back then :-/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine. Can you add unit tests ?
If the response is okay, I can add some tests. |
Codecov Report
@@ Coverage Diff @@
## master #37088 +/- ##
============================================
+ Coverage 64.76% 64.78% +0.02%
+ Complexity 19136 19132 -4
============================================
Files 1270 1270
Lines 74915 74912 -3
Branches 1328 1328
============================================
+ Hits 48517 48531 +14
+ Misses 26008 25991 -17
Partials 390 390
Continue to review full report at Codecov.
|
I've retested on Phoenix with my scenario and there are no more duplicates. Thanks! |
6ba198c
to
b7b533e
Compare
@PVince81 Manipulating ShareController tests is pretty complicated. I changed some ApiTest tests to cover requests with "include_tags = true" parameter. |
18cc718
to
ec953f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 from me. Would be good to also get approval from @micbar
changelog/unreleased/37088
Outdated
Bugfix: fix OCS Share API response for requests contain "include_tags" parameter | ||
|
||
Sending "include_tags" request parameter for OCS Share API was led to duplicated share entries in API response. | ||
This problem has been fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karakayasemi Can you describe the way it was fixed? "Reduced the complexity of ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@micbar I extended the changelog entry with more details. Please, review one more time. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
ec953f5
to
a35be4d
Compare
Description
This PR simplifies tag generations for shares and fixes the duplicate share entry problem described in #37084 .
populateTags
helper method is only used for tag generation for shares. There is no other usage of it in Github organization-wide. The method had too many nested loops. I simplified this method by customizing it for only shares.@PVince81 Can you confirm the response with this PR so that I don't miss a thing?
Related Issue
How Has This Been Tested?
Types of changes
Checklist: