nextcloud / nextcloud/server

[Bug]: FileSystem update and post_update signals do not dispatch events with IEventDispatcher

Open
#52,095 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

⚠️ This issue respects the following points: ⚠️
Bug description

Since version 18 is deprecated so I consider that it is a problem because in my case I am in version 31 and events like the ones I mention are still not migrated.: https://docs.nextcloud.com/server/latest/developer_manual/basics/events.html#hooks

The signal_update / signal_post_update signals of FileSystem are not subscribed to by HookConnector:

https://github.com/nextcloud/server/blob/9e0e53707f02c455bb5998130d0556ade7ca298f/lib/private/Files/Node/HookConnector.php#L46

Places where they are issued:

https://github.com/search?q=repo%3Anextcloud%2Fserver%20signal_update&type=code

https://github.com/search?q=repo%3Anextcloud%2Fserver+signal_post_update&type=code

In my case the one that interests me the most is this one because there is no way to find out when a file has been updated through IEventDispatcher other than NodeWrittenEvent which occurs in many use cases not only when you update the file:

https://github.com/nextcloud/server/blob/9e0e53707f02c455bb5998130d0556ade7ca298f/apps/dav/lib/Connector/Sabre/File.php#L435

Bonus: these uses of HookConnector should use FileSystem constants:

https://github.com/nextcloud/server/blob/9e0e53707f02c455bb5998130d0556ade7ca298f/lib/private/Files/Node/HookConnector.php#L46

Steps to reproduce

There is nothing to reproduce, in the code examples I put above you can see it clearly.

Expected behavior

There should be an event through IEventDispatcher in which you learn that a node has been changed.

Nextcloud Server version

31

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

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 lib/private/Files/Node/HookConnector.php and the signal_update and signal_post_update emissions linked in the issue, then inspect apps/dav/lib/Connector/Sabre/File.php around the referenced update path. Determine how these FileSystem signals should be represented through IEventDispatcher without relying on NodeWrittenEvent. Done means the relevant file-update events are dispatched and the HookConnector references FileSystem constants where appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.