nextcloud / nextcloud/server

Detect changes to files (using custom hooks)

Open
#46,588 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage enhancement feature: filesystem
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

I have built a 'hook' into the database of NextCloud and use it for it's cloud-drive capabilities and file management structure.

This is all working quite nicely, but when a file is moved the only way to process that change seems to do a complete database scan and compare the NextCloud tabel 'oc_filecache' to my table.

Detecting a new/newer file is now done using the field 'storage_mtime'

But I can't see a 'file move' nor a 'file rename' in the table. Could it be possible to simply update the 'storage_mtime' to "now"?

Or is there an other way?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the oc_filecache table and the storage_mtime behavior described in the issue, then trace the custom database hook used for file management. Determine how file moves and renames are represented and whether an existing event or metadata field can expose them without a complete table scan. Done means documenting or implementing a confirmed way to detect those changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.