Bug 466339

Summary: Error saving modified file in WebDAV mount on Windows
Product: [Applications] ghostwriter Reporter: Kym Eden <shikasta.net+kde>
Component: generalAssignee: megan.conkle
Status: CONFIRMED ---    
Severity: critical CC: kde.org-pk, megan.conkle, shikasta.net+kde
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Bug Depends on: 462242    
Bug Blocks:    

Description Kym Eden 2023-02-24 09:48:07 UTC
SUMMARY
While resaving a file hosted on WebDAV mapped to drive on Windows, ghostwriter fails with the error:
Error saving N:/notes/test.md
Writing cancelled by application

On the WebDAV (Apache) side I see the error:
This resource is locked and an "If:" header was not supplied to allow access to the resource.

The following bug report indicates that Word has the same problem, and it's something to do with the order or mechanism for saving (overwrite modified file doesn't release the lock first) 
https://www.apachelounge.com/viewtopic.php?t=7707 

Resaving succeeds when the share is mounted on Ubuntu with same version of ghostwriter (for linux).

STEPS TO REPRODUCE
1.  Map a WebDAV share (https://webdav.example.com/) to H:
2. Start ghostwriter
3. Save file anywhere in N:\
4. Try to save file again [ Ctrl ] + [ S ]

OBSERVED RESULT
Changes not saved, with error:
Error saving N:/notes/test.md
Writing cancelled by application

Only works if saved as a new file

EXPECTED RESULT
Saved changes to existing file

SOFTWARE/OS VERSIONS
Windows: 10
ghostwriter version 2.1.6 - portable
Docker image of httpd:bullseye-2.4.55 (Apache 2.4.55) hosting WebDAV.

Clone of bug 462242 because it may have been abandoned by the OP.