fix: only write activites for actual public uploads#2431
Open
miaulalala wants to merge 2 commits intomasterfrom
Open
fix: only write activites for actual public uploads#2431miaulalala wants to merge 2 commits intomasterfrom
miaulalala wants to merge 2 commits intomasterfrom
Conversation
Activity
|
||||||||||||||||||||||||||||
| Project |
Activity
|
| Branch Review |
fix/2016/false-public-folder-notification
|
| Run status |
|
| Run duration | 02m 06s |
| Commit |
|
| Committer | Anna |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
1
|
|
|
0
|
|
|
9
|
| View all changes introduced in this branch ↗︎ | |
ff667c4 to
130975d
Compare
Currently, any file activity without a proper session is interpreted to be a public upload. Now, the share token is compared and the activity is only written when the share token belongs to a public folder Signed-off-by: Anna Larch <anna@nextcloud.com>
130975d to
f297929
Compare
Signed-off-by: Anna Larch <anna@nextcloud.com>
artonge
reviewed
Mar 11, 2026
Comment on lines
+110
to
+119
| if (!empty($this->request->server['PHP_AUTH_USER'])) { | ||
| $token = $this->request->server['PHP_AUTH_USER']; | ||
| try { | ||
| $share = $this->shareManager->getShareByToken($token); | ||
| return $share->getShareType() === IShare::TYPE_LINK | ||
| || $share->getShareType() === IShare::TYPE_EMAIL; | ||
| } catch (ShareNotFound $e) { | ||
| // No share found for this token | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
Checking the share based on PHP_AUTH_USER would probably conflict the day a user as the same ID as a share. Share's tokens can be manually set nowadays.
Collaborator
Author
There was a problem hiding this comment.
hm, since it's for activities only, I think it's still better than what we have currently, which is writing an activity on any file action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, any file activity without a proper session is interpreted to be a public upload. Now, the share token is compared and the activity is only written when the share token belongs to a public folder
Fixes #2016