A Windows user reported losing nearly 800 GB of data after updating Telegram Desktop. Files began disappearing from the custom directory C:\custom immediately after launching the messenger, while folders themselves remained intact.
Tracing the culprit
By monitoring application launches, the user isolated the issue to Telegram Desktop. Reinstalling the application to a separate location and creating test files confirmed that Telegram continued to target the original folder. Testing across versions showed the problem appeared after updating from 6.9.4 to 7.1.1.
Process Monitor investigation
Running Process Monitor revealed that Telegram.exe opened C:\custom, enumerated its contents, requested delete permissions, and attempted recursive removal. Stack traces pointed directly inside the Telegram binary, ruling out malware.
Root cause in spell checking
The deletion originated from the lib_spellcheck library. Telegram stores user-added words in a file named custom. In version 7.1.0, changes to support Windows native spell checking introduced a logic error: the path to the internal dictionary was set after an early return when the system spell checker was active.
With an empty working directory path, the code constructed the string /custom. Qt resolved this to C:\custom on the root of the current drive. The subsequent check if (QFileInfo(path).isDir()) { QDir(path).removeRecursively(); } then deleted the entire folder instead of a small internal dictionary directory.
Fix and impact
Developers corrected the issue in commit 9c316281 by setting the path before the return and added an empty-path guard in lib_spellcheck. The faulty versions remained available for roughly 66 hours. The bug was confirmed only on Windows with native spell checking enabled.
The case demonstrates how individually reasonable decisions—storing custom words, cleaning damaged directories, and using recursive deletion—combined into severe data loss when path validation was absent.


