When editing a shared note through notes application (note has been shared and moved to notes folder), the edit fails to be saved, and on server side a LockedException is thrown, because it tries to move the file even if the note name didn't change (notesservice.php line 155).
However, when this line is commented out, the edit is successful.
Could you please disable renaming for shared notes, so multiple users can share and edit a todo list for instance ? Or find a way not to throw this exception ?
Currently, the note should not be renamed if the title didn't changed. Is this really the case at your installation? Then please add the following line in order to debug this behaviour (in notesservice.php line 155 before of the move command):
$this->logger->error('Move note from '.$currentFilePath.' to '.$newFilePath, ['app' => $this->appName]);
Please post the resulting log entry!
Second question: Does the LockedException happens for every user or only for users with the shared file (i.e., not for the user with "master" file)?
I am seeing the same thing -- share note file, move note file to Notes directory, edit in online Notes app -> "OCP\LockLockedException". I commented out line 155's move command, as suggested by dclaisse, which does allow the changes to be saved. I also enabled the logger command requested above, output of which is:
Error | notes | Move note from /MYUSERNAME/files/Notes/Am having trouble.txt/ to /MYUSERNAME/files/Notes/Am having trouble.txt | 2017-09-15T13:58:19-0700
-- | -- | -- | --
Note that the file names are not the same due to that trailing / in the currentFilePath.
When I do a 1 character edit on the file, the Error message fires once. When I do a short sentence, the Error message fires rapidly, multiple times -- 5 times in a row with 1 millisecond intervals in the timestamp, as an example.
Sorry for the late reply, but I confirm "master" user that shared the note does not encounter exception.
I also confirm that I see the same behaviour as seens by louis-eyond, the move code path is always triggered due to the '/' added at the end of file name.
Thanks for the additional information. I will try to find out where the
slash is introduced.
I was able to reproduce the exception. This happens only, if a single note is shared. It does not happen if you share a (sub)folder with notes (so this could be a workaround).
I will look further into it ...
Please test my fix and give feedback: #134
Fix #134 works for me ! thanks
Most helpful comment
Please test my fix and give feedback: #134