Bug 495859 - neochat room info json cache files fail to be written to disk when they contain wild characters, corrupting cache
Summary: neochat room info json cache files fail to be written to disk when they conta...
Status: RESOLVED UPSTREAM
Alias: None
Product: NeoChat
Classification: Applications
Component: General (show other bugs)
Version: 24.08.2
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Fella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-06 02:13 UTC by Aranjedeath
Modified: 2024-11-09 23:54 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aranjedeath 2024-11-06 02:13:57 UTC
SUMMARY
neochat tries to keep room info on disk in json files, but (apparently) cannot write the entire spectrum of valid file names

STEPS TO REPRODUCE
1. join https://matrix.to/#/#test:maunium.net
I did this from element and neochat was not open when it happened. Neochat was not open for a month or so before trying to sync this room using the reported version of neochat. I don't know if this matters, I am just noting it. 
2. open neochat
3. neochat reports corrupted cache and doesn't function well.

OBSERVED RESULT
Nov 05 17:42:34 sakura neochat[57173]: quotient.main: Error opening "/home/aranjedeath/.cache/KDE/neochat/@aranjedeath_explodie.org/!#test/room\nversion <u>11</u>, with @🐈_maunium.net.json" : "No such file or directory"

EXPECTED RESULT
neochat does not corrupt own cache and have a panic about it, and ideally supports emojis, vertical spaces, and other such weird but valid characters that can be present in room names. 

SOFTWARE/OS VERSIONS
KDE NEON USER
Operating System: KDE neon 6.2
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.8.0-48-generic (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-6600K CPU @ 3.50GHz
Memory: 15.6 GiB of RAM
Graphics Processor: AMD Radeon RX 5700 XT


ADDITIONAL INFORMATION
the room shows up in neochat, and you can generally view posts. if you try to touch room settings or any of those buttons (which I suspect would try to read the non-existent json file for the room), it crashes. 

After that crash, startup reports this:
Nov 05 18:07:26 sakura neochat[63931]: quotient.main: Unresolved rooms: "!#test/room\nversion <u>11</u>, with @🐈:maunium.net"
Nov 05 18:07:26 sakura neochat[63931]: quotient.main: No state cache file "/home/aranjedeath/.cache/KDE/neochat/@aranjedeath_explodie.org/!#test/room\nversion <u>11</u>, with @🐈_maunium.net.json"

This shows the crash itself from tapping the room settings button

Nov 05 18:07:16 sakura systemd[1324]: app-org.kde.neochat@d9db6db5e9784ecba52116bf783cfd2e.service: Consumed 46.049s CPU time, 1.4M memory peak, 0B memory swap peak.
Nov 05 18:07:16 sakura systemd[1324]: app-org.kde.neochat@d9db6db5e9784ecba52116bf783cfd2e.service: Failed with result 'exit-code'.
Nov 05 18:07:16 sakura systemd[1324]: app-org.kde.neochat@d9db6db5e9784ecba52116bf783cfd2e.service: Main process exited, code=exited, status=255/EXCEPTION
Nov 05 18:07:16 sakura neochat[57173]: The Wayland connection experienced a fatal error: Too many open files
Nov 05 18:07:16 sakura neochat[57173]: Error marshalling request: Too many open files
Nov 05 18:07:16 sakura neochat[57173]: error marshalling arguments for add: dup failed: Too many open files
Nov 05 18:07:16 sakura neochat[57173]: qrc:/qt/qml/org/kde/desktop/CheckBox.qml:24: TypeError: Cannot read property 'y' of null
Nov 05 18:07:16 sakura neochat[57173]: qrc:/qt/qml/org/kde/desktop/CheckBox.qml:24: TypeError: Cannot read property 'y' of null
Nov 05 18:07:16 sakura neochat[57173]: qrc:/qt/qml/org/kde/neochat/settings/RoomGeneralPage.qml:331: TypeError: Cannot read property 'canSendState' of null
Nov 05 18:07:16 sakura neochat[57173]: qrc:/qt/qml/org/kde/kirigami/dialogs/Dialog.qml:401:33: QML Binding: Binding loop detected for property "value":
                                       qrc:/qt/qml/org/kde/kirigami/dialogs/Dialog.qml:409:13
Nov 05 18:07:16 sakura neochat[57173]: qrc:/qt/qml/org/kde/kirigami/dialogs/Dialog.qml:344:18: QML ScrollView: Binding loop detected for property "calculatedImplicitHeight":
                                       qrc:/qt/qml/org/kde/kirigami/dialogs/Dialog.qml:361:9
Nov 05 18:07:14 sakura neochat[57173]: qrc:/qt/qml/org/kde/neochat/qml/RoomInformation.qml:223: TypeError: Cannot read property 'userListSearchField' of null
Nov 05 18:07:14 sakura neochat[57173]: QQmlComponent: Cannot create new component instance before completing the previous
Nov 05 18:06:56 sakura neochat[57173]: quotient.main: Error opening "/home/aranjedeath/.cache/KDE/neochat/@aranjedeath_explodie.org/!#test/room\nversion <u>11</u>, with @🐈_maunium.net.json" : "No such file or directory"
Nov 05 18:06:56 sakura neochat[57173]: Trying to access a room member not in the user list
Nov 05 18:06:56 sakura neochat[57173]: Trying to access a room member not in the user list
Comment 1 Joshua Goins 2024-11-09 23:54:09 UTC
This should be reported to libquotient (https://github.com/quotient-im/libQuotient), NeoChat doesn't do any of this itself