Repository navigation
feat(files): add an API to report that a user opened a file - #65994
Merged
Merged
Conversation
Reading a file is not opening it: sync clients, previews and downloads all fire BeforeNodeReadEvent. Clients can now call POST /ocs/v2.php/apps/files/api/v1/opened when the user actually opens a file or folder, which dispatches a NodeOpenedEvent apps can listen to. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
skjnldsv
marked this pull request as ready for review
October 29, 2026 02:56
skjnldsv
requested review from
icewind1991,
leftybournes and
sorbaugh
and removed request for
a team
October 29, 2026 02:56
Member
Author
|
Ready! it's quite straightforward :) |
CarlSchwan
reviewed
Oct 29, 2026
CarlSchwan
approved these changes
Oct 29, 2026
Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
susnux
approved these changes
Oct 29, 2026
Clients report opens when they choose to, so the event can be missing, repeated, or sent for a node the user never looked at. Make clear it must not be used for permissions, access control or auditing. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
skjnldsv
disabled stacked auto-merge
October 29, 2026 15:28
Member
Author
|
CI failures are unrelated: the PHPUnit ones fail the same way on other PRs today (e.g. https://github.com/nextcloud/server/actions/runs/40871288892), Azure fails on Azurite XML parsing, and Playwright passed on re-run. |
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.
Summary
Reading a file isn't opening it.
BeforeNodeReadEventfires for sync clients, previews and downloads, so apps can't tell what a user actually works with.This adds
POST /ocs/v2.php/apps/files/api/v1/openedwith afileId. It dispatches a newNodeOpenedEventwith the node and the user. It's public on purpose, so the viewer, the "Open locally" action and desktop/mobile clients can all report opens. Recommendations will use it for recent and frequent files.Folders are accepted too. The rate limit (100/min per user) is a guess, happy to adjust.
Next
Checklist
3. to review, feature component)stable32)AI (if applicable)
👾 This pull request was assisted by Claude Code, commits carry an
Assisted-bytrailer.