-
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
Avoid duplication of public quick links on the same resource #39167
Conversation
After checking out this branch I thought that I would have to do something to get the databse migration to run. But:
And when I click the "quick link" button in the UI, I get "The public link could not be created. Please contact the administrator for help." Is there something else that needs to happen so that the new migration in |
"This branch is 5 commits ahead, 9 commits behind master." |
@phil-davis we had running it via |
That is probably true. Should the version be bumped now, in this PR? |
@phil-davis I thought versions will be bumped if a new release of the core will be done ? I don't know the process in detail maybe @micbar knows? |
4eb54c3
to
1e5c8cb
Compare
Oh! Migrations of the share table? This is unexpected for me. |
@phil-davis I bumped the version string, as recognized, that it was bumped before as migrations came in 👍 |
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.
Tested and works: Then:
This looks good. It just needs a decision about the implementation of how to remember which link is the "Public quick link". |
1e5c8cb
to
3c5dc6e
Compare
I'm not sure if we need this... I mean, you can have multiple links with different permissions, so for me it's fine to prevent creating a link if it has the same permissions of another link (we might need to add some additional checks such as having the same owner). |
We had the same initial idea. A Public quick link is created with the following props:
Hence we would need to search for a link matching all these values. Which is hardly possible if the expiry gets set automatically. Also what happens if you've created a public link via quick action and then change it to read-write? In this case, a quick action would create another public link. So we decided this might be the easiest way to achieve this, even though it includes a migration. |
There might be multiple public links with read-only permission. They might have different expiry dates. The user might have "manually/purposely" created multiple read-only public links, even all with the same expiry date (or no expiry date) so that they can give individual public links to different people. The rule could be that if there is any read-only public link(s) already existing, then clicking the "quick link" button will copy the "first" one found to the clipboard. But the user probably would like the behavior to be:
(1) and (2) are easy. (3) is easy of there is only 1 read-only public link. (3) is harder if someone creates a read-only "quick link" and then goes into the full Public Links panel and creates other read-only public links, and changes all their names etc. It might be more difficult to know which was the "first" one created by the "quick link" icon. Maybe there is already some primary-key or... sorting in the table that can be used to reliably choose the "first" one, regardless of if the name, expiry date... have been changed later. |
I expect the expiration for the quick link will be set, for example to the 23th Sept at 00:00 (or 23:59), so if you click again on the same date, the expiration should be the same.
The link is different due to different permissions, so for me it's ok. The key point for me is that the quick link action just creates a new link with specific data. That's all it needs to do. I expect the DB and / or the share manager to take care of duplicates in order to return a specific error. Maybe what it's lacking is a way to tell the user that the quick links will be generated in a particular way, such as read-only and expiring in 15 days (or whatever is configured) |
Unfortunately, this is not fine for the customer, as spoken with @pmaier1
In which case should an error message be shown? This is not user friendly in any way We should really implement an as easy as possible solution, like this PR does |
Yes, for the customer, and even for a user like me, I would like that if I:
This PR achieves the above. There might be other trickier ways to achieve the requirement without a database table migration - someone (tm) has to decide if it is worth trying to implement a "trickier way" that really covers edge cases... |
3c5dc6e
to
9b5f83e
Compare
We decided to use the |
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.
Works for me. I checked cases like:
- logout and login again. The original quick-link is remembered
- create an ordinary read-only public link, then a "quick link". The one that is a "quick link" is correctly remembered.
- share to another user. The other user creates a quick link of the received share. It works
the db migration has been removed
Kudos, SonarCloud Quality Gate passed! |
Description
Enhancement: Extend public quick link feature
With this PR, public quick links created via the quick links icon in the file list will be created only once. We do this by adding
isQuickLink
to the share's attributes. See https://github.com/owncloud/enterprise/issues/4730#issuecomment-911610309 for the expected behavior.Extends #39130
Related Issue
Screenshots (if appropriate):
Types of changes
Checklist: