desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Automatic File Locking only Working on Specific Filetypes

Open AT-StephenDetomasi opened this issue 1 year ago • 8 comments

The desktop client only set locks automatically on a very limited range of file types.


Scenario:

User A opens an .odt and .docx file. User A opens a .pdf, .dwg, or any other file User B tries to open the same files as User A

What happens:

User B can see a lock icon next to the .odt and .docx files, and is presented with a banner to indicate that the file is read only when they attempt to open it. The other files do not have a lock icon, and User B can edit and overwrite the data, leading to sync conflicts.

What should happen / is expected:

User B should see a lock icon next to all files that are currently in use, and should not be able to edit files that are in use.

System Configuration

NextCloud Server Version: 28.0.3 (AIO, Docker) NextCloud Client Version: 3.12.2 Operating System: Windows 11 23H2 Notable Apps: Files Lock, Group Folders

AT-StephenDetomasi avatar Mar 29 '24 01:03 AT-StephenDetomasi

Anyone...?

AT-StephenDetomasi avatar Apr 09 '24 02:04 AT-StephenDetomasi

We are having the same issue

simon-hartmann avatar Apr 15 '24 06:04 simon-hartmann

Has anyone tried NextCloud 29? I saw a few reports of people having issues with other things... so I'm not really game to try it.

AT-StephenDetomasi avatar Apr 30 '24 14:04 AT-StephenDetomasi

This is still an issue in NextCloud 29.

AT-StephenDetomasi avatar Jul 15 '24 02:07 AT-StephenDetomasi

Are you using richdocuments (Collabora) or is this about the desktop client?

susnux avatar Aug 13 '24 17:08 susnux

Desktop client. Sorry I thought that part was self explanatory, you cannot open DWG files in the web interface.

AT-StephenDetomasi avatar Aug 14 '24 02:08 AT-StephenDetomasi

Desktop client. Sorry I thought that part was self explanatory, you cannot open DWG files in the web interface.

I believe you can: https://apps.nextcloud.com/apps/cadviewer

joshtrichards avatar Aug 21 '24 13:08 joshtrichards

Yes but you cannot edit it from there, it's just a viewer. Either way, the primary issue I am seeing is with opening files within the file explorer in Windows 11.

AT-StephenDetomasi avatar Aug 24 '24 04:08 AT-StephenDetomasi

Any enhancement about that ? We need this feature too, especially for .dwg. Is there any technical challenge ? How does it work with office files, and why couldn't it work the same way for other type of files ?

tomdereub avatar Oct 16 '25 08:10 tomdereub

@tomdereub There are lists of known (Office) file extensions and some general patterns that indicate a lockfile in src/libsync/filesystem.cpp.

depending on how file locking works with .dwg (AutoCAD I suppose?) adding support for that could be to justâ„¢ add another entry there

nilsding avatar Oct 16 '25 08:10 nilsding

Ok thanks. So what should be done, if I understand well, is :

  • change the check to be able to check suffix and not only prefix. So maybe check on full file name and not juste begin (std::cbegin(lockFilePatterns))
  • change the lockFilePatterns list, with something like that constexpr std::array<const char *, 2> lockFilePatterns = {{".~lock.*", "~$*","*.dwl"}};
  • change the officeFileExtensions list adding .dwg (and then the name with office would make no more sense)
  • add "*.dwl" to the default exclude list of the client

I'm no dev, so I may misunderstand somethings, and maybe it's not that simple, let me know. It would be interesting too to ask for the community if there are other file types that would be worth adding ?

tomdereub avatar Oct 16 '25 10:10 tomdereub