-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Fix public download activity #51458
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 public download activity #51458
Conversation
This one is not a regression so let’s postpone for later. |
|
/backport to stable31 |
|
I would like to add tests for this, but activity application is needed. |
Is there no OCS API or something you can test with behat? Otherwise I see two ways:
|
|
Just a heads-up: I had the same issue (downloads of individual files from a shared folder weren't showing up in the activities, #51097). I can confirm that the suggested changes solve the problem for me. |
Well, that's how it used to be. If you watched a video, it would show up in the "downloaded via public link" log. For images, you had to click "download" for it to show up in the log. Just viewing the image didn't do it. For me, it's more important to see the explicit downloads (of an image) instead of just viewing it in the gallery. If both are to be logged, I'd prefer to see two different events ("viewed" and "downloaded"). |
|
Did not yet had time to test this, but old behavior was also inconsistent as there were some endpoints that never caused a download notification. Because either it only means real downloads, then we only need to track the DAV endpoints ( If I get the code right then this PR implements both. Which is fine but might confuse users as they will see "file downloaded" notifications even if they set "download permission" to |
|
I see two options here:
|
It’s DAV, not OCS, but that can be tested with behat. But still needs the activity app.
I will try that.
No, this PR only logs downloads through DAV, kind of the same as old behavior. Actually, something I did not test is if a public link is loaded in which there is a file with no preview yet. Then opening the folder may trigger the preview computing and a download activity. But I’m not 100% sure that is possible in real life. How do you share a folder without triggering preview caching? |
Opening an image in viewer also always triggers new preview generation as the image shown in viewer is basically a big preview. Thats what I meant with "view activity" |
94802cf to
eb5ad83
Compare
d8b2603 to
4fbff98
Compare
4fbff98 to
eb5ad83
Compare
Even if dav endpoint is now used. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Remove duplicate activity publishing from share controller download, listen to BeforeZipCreatedEvent to publish activity for folders, and cache folders activity to avoid sending activity for each file in the folder. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
…e file Avoids flooding activities when someone browse a video in the web player. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
…the request Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
…urrency issues If several people are watching and seeking the same video file we do not want the cache key to be the same or it would flood activity again. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Fixes "Object for placeholder file is invalid, value 21 for key id is not a string" Exception spotted in tests logs. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
eb5ad83 to
da9b6e3
Compare
Summary
Fix pubilc download activity in 31+, and improve upon it to make sure it’s consistent.
TODO
Viewing a photo through preview does not trigger activity, is that an issue?Checklist