fix OCS Share API response for requests contain "include_tags" parameter#37088
fix OCS Share API response for requests contain "include_tags" parameter#37088karakayasemi merged 1 commit intomasterfrom
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.
I can't remember the reason for such complex code back then :-/
PVince81
left a comment
There was a problem hiding this comment.
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
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.
@karakayasemi Can you describe the way it was fixed? "Reduced the complexity of ..."
There was a problem hiding this comment.
@micbar I extended the changelog entry with more details. Please, review one more time. Thanks.
ec953f5 to
a35be4d
Compare
Description
This PR simplifies tag generations for shares and fixes the duplicate share entry problem described in #37084 .
populateTagshelper 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: