Skip to content

feat: report the files the viewer opens to the server - #180

Merged
skjnldsv merged 2 commits into
mainfrom
feature/report-opened
Oct 29, 2026
Merged

skjnldsv merged 2 commits into
mainfrom
feature/report-opened

Conversation

@skjnldsv

Copy link
Copy Markdown
Contributor

The server is getting an API to say "the user opened this file" (nextcloud/server#65994), so recommendations can suggest what people actually work with instead of what sync clients read. The viewer is where most opens happen, Files, Talk, Deck, Text and Office included, so it reports there.

Relates to nextcloud/recommendations#888

Only the file the viewer was asked to open counts. Stepping through the others is browsing, so a gallery isn't 200 opens. Opening the file that's already shown doesn't count twice either. Guests and files from public shares report nothing, since there's no file id for the user to open.

Servers before 36 answer 404, which is only logged for debugging. Opening never waits on the request.

Unit tests cover the service. I haven't tried it against a real server yet.

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

So apps like recommendations know what the user works with. Only the
file the viewer was asked to open counts, not the ones the user steps
through, and nothing is reported for guests or public shares. Servers
before 36 have no such endpoint: their 404 is only logged for debugging.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv skjnldsv self-assigned this Oct 29, 2026
Tests that mock @nextcloud/axios without it made the report throw from
its catch, an unhandled rejection in every test opening a file. Check
the status the way the rest of the viewer does.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.02%. Comparing base (9feca65) to head (b7b87cd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #180      +/-   ##
==========================================
+ Coverage   91.98%   92.02%   +0.03%     
==========================================
  Files          54       55       +1     
  Lines        4643     4666      +23     
  Branches     1014     1018       +4     
==========================================
+ Hits         4271     4294      +23     
  Misses        346      346              
  Partials       26       26              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@skjnldsv
skjnldsv merged commit 26fa7fc into main Oct 29, 2026
20 checks passed
@skjnldsv
skjnldsv deleted the feature/report-opened branch October 29, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants