-
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
Adjust expiration logic for shares to account for share attributes registered with apps #36766
Conversation
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 good
Codecov Report
@@ Coverage Diff @@
## master #36766 +/- ##
============================================
- Coverage 64.68% 64.68% -0.01%
+ Complexity 19122 19114 -8
============================================
Files 1269 1269
Lines 74779 74801 +22
Branches 1320 1327 +7
============================================
+ Hits 48373 48383 +10
- Misses 26018 26027 +9
- Partials 388 391 +3
Continue to review full report at Codecov.
|
I rebased and force-pushed because this was getting weird drone errors. Let's see what an up-to-date CI run says. |
@phil-davis We need to make sure, that this JS api does not break again. @mrow4a |
1a9726c
to
f6ee573
Compare
@phil-davis could you have a look now? |
Here is a strange behaviour:
Expected behaviour: the expiration date is cleared, and all permissions checkboxes remain as they are. Actual behaviour: the expiration date is cleared, and the Secure View checkbox gets "automagically" unchecked. This "normal" core scenario works fine:
The expiration date is cleared, the permissions checkboxes remain as they are - correct. |
https://drone.owncloud.com/owncloud/core/22714/46/13
and
Which is the same problem as in the unit tests. |
1183987
to
1c1dc1b
Compare
@davitol @phil-davis thank you for your excellent work in helping to spot an issue and review ! This was very helpful
|
532a51c
to
45a386d
Compare
@davitol @phil-davis just tested with onlyoffice/collabora in reshare and some complicated scenarious also manually, and all good. |
This LGTM now. I tried with richdocuments and the secure-view checkboxes work for me along with the other "ordinary" permissions checkboxes. @micbar can someone review the code? If all OK then we could merge. |
Note: issue #36813 is an existing problem when sharing with a user and a group that have the same name. Now that we have an expiration date field, that field has the same issue when there is this "duplicate" sharing. So that is not the fault of the new expiration date code. |
@mrow4a Please create a changelog item #36766 (comment) |
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.
See comments
core/js/sharedialogshareelistview.js
Outdated
@@ -122,13 +120,15 @@ | |||
/** @type {Function} **/ | |||
_template: undefined, | |||
|
|||
_currentlyToggled: [], |
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.
this has been declared as indexed array but its usage looks like it's a hash array instead, so would need to be declared as {}
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.
thanks! I overlooked it!
core/js/sharedialogshareelistview.js
Outdated
var shareId = $li.data('share-id'); | ||
|
||
if (!_.isUndefined(this._currentlyToggled[shareId])) { | ||
this._currentlyToggled.splice(shareId, 1); |
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.
if _currentlyToggled
is meant to be used as a hash array (aka object), use delete(this._currentlyToggled[shareId])
to delete the key.
I'm a bit surprised the current approach even worked
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.
Yes, good point, overlooked.
mostly minor comments, most critical is likely https://github.com/owncloud/core/pull/36766/files/2df82086ff878d95a8ec1e05fdf77cc20fb9a1a4#diff-e8d8565fb4fcb24d2ff551b5e127cf6a |
@micbar do we need to add changelog items for bugfixes to features that were never released yet? There will already be a changelog for feature "user/group share expiration". This PR simply fixes that feature, before the feature ever got released. |
Good question, we need to consider that we released 10.4.0RC1 already and the PR will show up zj the detailed git compare list anyway. I don't have a strong opinion on that, we could kind of merge it into the Original item by adding this pr link. That seems like the best solution. |
b1e9361
to
7ffd5bf
Compare
@micbar @phil-davis @PVince81 adjusted to the review |
…gistered with apps
…tments to share expiration js code
I added a changelog for #36813 to the last commit. The last commit fixes that issue (tested manually). |
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.
LGTM and tested manually.
I will think about how I can add some automated UI acceptance tests for the sharing with both user and group scenario. But that could be added later (does not have to hold up merging this PR).
@PVince81 please review the code again.
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.
👍 looks fine now, thanks for fixing
Issue to make generally better acceptance test coverage of these UI sharing permissions/expiration date for when there are multiple shares of the the same resource: #36818 |
related issue: #36751
also last commit fixes #36813