telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.23k stars 5.2k forks source link

"Export chat history" on Linux does not save any data #28267

Closed HibGut closed 2 months ago

HibGut commented 2 months ago

Steps to reproduce

Default:

  1. Enter a group.
  2. From the 3 dots at the top-right, click "Export chat history"
  3. In the "Chat export settings" window, leave all settings as pre-selected by default. 1 defaults
  4. Click "Export" 2 export complete
  5. After the process finished, click "Show my data".

Alternative 1:

  1. In the "Chat export settings" window, leave all settings as pre-selected by default, but do click on the Path value "Downloads/Telegram Desktop"
  2. A file chooser opens at the Downloads folder location. Do not navigate to any other other location, click directly on "Select" in the file chooser 3 select Downloads
  3. Continue as in Default

Alternative 2:

  1. In the "Chat export settings" window, leave all settings as pre-selected by default, but do click on the Path value "Downloads/Telegram Desktop"
  2. A file chooser opens at the Downloads folder location. Navigate to some other other location, click "Select" in the file chooser
  3. Continue as in Default

Expected behaviour

Default: To find a folder called "ChatExport [name of group]" within a folder called Telegram Desktop within my Downloads folder. This ChatExport folder should contain all saved messages and media.

Alternative 1:

  1. The Path setting in the "Chat export settings" window to remain on Downloads/Telegram Desktop because I didn't select anything different in the file chooser.
  2. To find a folder called "ChatExport [name of group]" within a folder called Telegram Desktop within my Downloads folder. This ChatExport folder should contain all saved messages and media.

Alternative 2:

  1. The Path setting in the "Chat export settings" window to change to the newly selected location.
  2. To find a folder called "ChatExport [name of group]" within the newly selected location. This ChatExport folder should contain all saved messages and media.

Actual behaviour

Default: The ChatExport folder does not exist anywhere. The Telegram Desktop folder is not created.

Alternative 1 and 2:

  1. The Path setting in the "Chat export settings" window changes to /run/user/1000/doc/[random 8 hex digits], not matching the location picked in the file chooser. 4 different path
  2. "Export your data" process window briefly appears, showing "Initializing"
  3. "Export your data" window shows "Disk error happened :(" Nothing is exported. 5 disk error

Operating system

GNOME 43.9 on Debian 12

Version of Telegram Desktop

Telegram 5.3.2

Installation source

Flatpak

Crash ID

No response

Logs

No response

ilya-fedin commented 2 months ago

Hm, I can reproduce only the default case on my KDE machine. The description of the rest of the issue looks very like you have encountered some xdg-desktop-portal-gnome bug. You can try a distro with newer GNOME version, maybe it's fixed there (but I wouldn't be surprised if it's not and you have to report it to GNOME). Or maybe you need to know some GNOME-specific setting to make it work. Sadly I can't guide you here as I'm not a GNOME user, you have to refer to Debian/GNOME support channels. Or you can switch from flatpak to unsandboxed build to avoid the GNOME's middleman altogether.

HibGut commented 2 months ago

very like you have encountered some xdg-desktop-portal-gnome bug.

Looks like that may be true. I have no idea what xdg-desktop-portal-gnome is (I'm just a user, no sysadmin or dev), but after some investigation I found that /run/user/1000/doc/ is locked doc directory locked ... and appears with a wrong date: doc directory wrong date The [random 8 hex digits] directories inside doc all appear to be created by Flatpak apps. The one belonging to Telegram has a Downloads folder inside, which maps to the real Downloads folder, probably a hard link. doc dir Downloads

Maybe the lock prevents Telegram from writing data? There is an open bug on the Flatpak Github that's probably the same issue https://github.com/flatpak/xdg-desktop-portal/issues/553 (df /run/user/1000/doc also gives me Operation not permitted) and people in there mention this xdg-desktop-portal thing.

But as I said, IDK what that is and already spend way more time than I should on trying to hunt down something that should just work. At the end, I don't really want to learn the details of obscure internal components, I just want Downloads to work.

Does the merge mean the default download is going to work at the next release?

ilya-fedin commented 2 months ago

Maybe the lock prevents Telegram from writing data?

IIRC there was some drama that the GNOME portal implementation provides directory access as read-only for flatpak apps. It seems they provide better security at the price of applications like tdesktop being unable to write data. KDE folks seem to be more pragmatic so their implementation works just fine.

Does the merge mean the default download is going to work at the next release?

Hope so. Have no way to test until release.

ilya-fedin commented 2 months ago

IIRC the right issue is https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/41