Bug 465762

Summary: kate overwrites symlinks as regular files
Product: [Frameworks and Libraries] frameworks-kio Reporter: Adam Gergely <admin>
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: REPORTED ---    
Severity: normal CC: christoph, kdelibs-bugs-null
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Adam Gergely 2023-02-15 12:51:51 UTC
SUMMARY
***
When using Kate to edit a file (in my example, on an SFTP connection in Dolphin), if I edit a file which is a symlink (relative path) to the real file, when I open the symlink it correctly reads the original file (the symlink's target) and imports the contents in the Kate window. But, when I make modifications, the symlink gets overwritten by a regular file which contains my modificaitons, but it is a separate file. Inspecting the original file (the symlink's target) does not reveal the modifications.
Other programs, such as LibreOffice, automatically save to the correct target file, even if opening and editing the Symlink.
***


STEPS TO REPRODUCE
1. Open an SFTP connection to a remote folder
2. Create a regular TXT file and edit something in it
3. In another directory on the remote SFTP server, create a Symbolic Link to the regular TXT file
4. When browsing on the remote folder, open the symbolic link with Kate. It should open the contents of the regular TXT file
5. Try to modify something in the file and Save
6. Upon save, KDE/Kate will replace te symbolic link with a regular TXT file containing the modificaitons. (the original TXT file will not be modified)

OBSERVED RESULT
Upon save, KDE/Kate will replace te symbolic link with a regular TXT file containing the modificaitons. (the original TXT file will not be modified)


EXPECTED RESULT
Upon save, KDE/Kate should retain the symbolic link and the modifications should be visible in the original target file of the symlink.


SOFTWARE/OS VERSIONS
Windows: -
macOS: -
Linux/KDE Plasma: Kubuntu 22.04.1 LTS
(available in About System)
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
Comment 1 Christoph Cullmann 2023-04-29 16:53:44 UTC
This looks for me rather like an issue of the fish io worker.