-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
1. to developAccepted and waiting to be taken care ofAccepted and waiting to be taken care of32-feedbackbugfeature: sharing
Milestone
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
There might be a race condition in ShareProvider, where several requests in parallel check if share exists in DB, and create it otherwise. In this case, there could be several new entries created, each with unique id, but all pointing to the same share.
If user tries to modify/leave share, it will modify the first row only, keeping the second intact. That way, you can never get rid of it.
Steps to reproduce
Don't have clear steps, but example behaviour sounds logical:
- Sharing a file in Talk creates a parent entry with
share_type10 andfile_target/{TALK_PLACEHOLDER}/file.md - User access conversation with shared file as last message, filesystem is mounted from conversations request and chat messages request
- This creates two entries in DB with
share_type11 andfile_target/Talk/file.md (best reproducible when PHP debugger was enabled, but also occurs on prod/daily instances)
3.1. Worse case if user at some point changed the attachments folder, so initial entry isshare_type11 andfile_target/Talk/file.md, and duplicates areshare_type11 andfile_target/SomeOtherPath/file.md. Modifications will touch only first occurence of /SomeOtherPath/file.md
Expected behavior
Some sort of transactional lock (to write in DB only once) in place
Nextcloud Server version
master
Details
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
1. to developAccepted and waiting to be taken care ofAccepted and waiting to be taken care of32-feedbackbugfeature: sharing
Type
Projects
Status
📄 To do (~10 entries)