Skip to content

fix(files): include recently uploaded files in Folder::getRecent() - #65998

Open
skjnldsv wants to merge 3 commits into
masterfrom
fix/recent-include-uploads
Open

skjnldsv wants to merge 3 commits into
masterfrom
fix/recent-include-uploads

Conversation

@skjnldsv

Copy link
Copy Markdown
Member

Summary

#58327 made the Files app's Recent view look at upload time, since an upload keeps the mtime the file had on the uploader's device. Folder::getRecent() was left on mtime only, so a photo taken last month and uploaded today is in Files > Recent but not in getRecent().

This follows up on #58327: getRecent() now also takes files uploaded in the last two weeks, and orders by last activity, the later of mtime and upload time. Recommendations' "recently edited" source is built on it, and the legacy /apps/files/api/v1/recent endpoint too.

To reproduce, upload a file with an old mtime:

curl -u alice:alice -X PUT -H "X-OC-MTime: $(( $(date +%s) - 40*86400 ))" --data photo https://cloud/remote.php/dav/files/alice/holiday.jpg

It's in Files > Recent, but not in getRecent() or the recommendations.

The new test fails without the change.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

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

Uploads keep the mtime of the file they come from, so a file uploaded
today with an older mtime was not recent for getRecent(), while the
Files app's recent view, which looks at the upload time as well, shows
it. Use the same last activity, the later of both, here.

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
@skjnldsv
skjnldsv requested a review from a team as a code owner October 29, 2026 07:11
@skjnldsv
skjnldsv requested review from Altahrim, icewind1991 and leftybournes and removed request for a team October 29, 2026 07:11
@skjnldsv
skjnldsv requested review from sorbaugh and susnux October 29, 2026 07:11
The last activity order was built as raw SQL, `COALESCE(fe.upload_time, 0)`,
so Oracle read the unquoted name as "FE"."UPLOAD_TIME" and failed with
ORA-00904. Build it with the function builder, which quotes it.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
Oracle binds the parameter as text, and COALESCE refuses to mix it with
the number column (ORA-00932). The default is a constant, so write it in
the query.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant