Bug 473511 - Filesystem Expose has been broken ever since version 1.24 of kdeconnect
Summary: Filesystem Expose has been broken ever since version 1.24 of kdeconnect
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: android-application (other bugs)
Version First Reported In: unspecified
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-18 16:11 UTC by samuelsmash
Modified: 2024-08-11 09:07 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description samuelsmash 2023-08-18 16:11:56 UTC
SUMMARY
***
Ever since version 1.24 of kdeconnect, the filesystem expose feature has been broken for several months.

I asked about this issue on reddit at that time, I didn't have time to file a bug report so here you can see the issue more in detail: https://old.reddit.com/r/kde/comments/12w8p4l/the_last_version_of_kde_connect_broke_the/

I have been using version 1.23.2 ever since, today I tried 1.27.1 and the issue is still there. 

***


STEPS TO REPRODUCE
1.  Try to use the filesystem expose feature with kdeconnect 1.24.0 or newer.

OBSERVED RESULT

Clicks on browse device on my PC just results in failure.

EXPECTED RESULT

My file browser should open showing the directories that I selected on kdeconnect.

SOFTWARE/OS VERSIONS

PC:
Arch Linux
Kernel 6.4.10-arch1-1.1
i3wm
kdeconnect from the arch repos

Smartphone: 

Xiaomi Redmi 9
LineageOS 20.
kdeconnect from F-Droid.
Comment 1 Albert Vaca Cintora 2023-08-20 21:05:22 UTC
This is probably the change that affects you: https://invent.kde.org/network/kdeconnect-android/-/commit/1ba9e59872e811615a152882469e9b9f07cc7001

What we are doing since this change is request permissions to have full access to the storage, instead of requesting it folder by folder (since recently some folders are not allowed accessing otherwise).

This permission doesn't appear in the regular list of app permissions in Android, similar to the permission to access notifications it has its own menu.

However, we should detect it is missing and show a link in-app that opens the screen where you can grant the permission. Maybe there's something broken and this link doesn't show?
Comment 2 samuelsmash 2023-08-21 20:33:19 UTC
(In reply to Albert Vaca from comment #1)
> This is probably the change that affects you:
> https://invent.kde.org/network/kdeconnect-android/-/commit/
> 1ba9e59872e811615a152882469e9b9f07cc7001
> 
> What we are doing since this change is request permissions to have full
> access to the storage, instead of requesting it folder by folder (since
> recently some folders are not allowed accessing otherwise).
> 
> This permission doesn't appear in the regular list of app permissions in
> Android, similar to the permission to access notifications it has its own
> menu.
> 
> However, we should detect it is missing and show a link in-app that opens
> the screen where you can grant the permission. Maybe there's something
> broken and this link doesn't show?

The app has the permission to access all files, however when I click on browse device on the PC what happens is that the file manager opens and empty directory which I can't do anything with: https://imgur.com/4DaUlLW.png
Comment 3 Kurt.Hornik@wu.ac.at 2023-08-28 09:21:37 UTC
I have exactly the same problem you describe in your old post: 

  When you go to the plugin settings in 1.24 and later the filesystem
  expose option only has a toggle now, so I can only turn it on or off,
  but there is no longer the option to select which folders are to be
  exposed

Specifically, this occurs with my Samsung Galaxy S10 running Android 12, 
but not with my Huawei MediaPad tablet running Android 8.  I am seeing 
the problem with both gsconnect and kdeconnect.

I think I gave the kdeconnect apps all permissions I can give.

Any ideas why I cannot select the folder to expose?
Comment 4 samuelsmash 2023-08-30 04:08:29 UTC
(In reply to Kurt.Hornik@wu.ac.at from comment #3)
> I have exactly the same problem you describe in your old post: 
> 
>   When you go to the plugin settings in 1.24 and later the filesystem
>   expose option only has a toggle now, so I can only turn it on or off,
>   but there is no longer the option to select which folders are to be
>   exposed
> 
> Specifically, this occurs with my Samsung Galaxy S10 running Android 12, 
> but not with my Huawei MediaPad tablet running Android 8.  I am seeing 
> the problem with both gsconnect and kdeconnect.
> 
> I think I gave the kdeconnect apps all permissions I can give.
> 
> Any ideas why I cannot select the folder to expose?

My only solution so far has been running KDEConnect version 1.23.2, you can get the older versions by using f-droid.
Comment 5 Kurt.Hornik@wu.ac.at 2023-08-30 05:00:01 UTC
Thanks.  I had found this suggestion and tried, but my phone said that I don't have the permissions for doing that.
Comment 6 Albert Vaca Cintora 2023-09-06 02:45:47 UTC
Git commit 393624af9c6cf1af8bf2b912a4acaeb06abdbb40 by Albert Vaca Cintora.
Committed on 06/09/2023 at 04:45.
Pushed by albertvaka into branch 'release/23.08'.

Fix SFTP plugin on Windows

Broken by https://invent.kde.org/network/kdeconnect-android/-/merge_requests/320

(cherry picked from commit 4d5474db7bc2a573063415ff3e9156a605b67794)

M  +9    -1    plugins/sftp/sftpplugin-win.cpp

https://invent.kde.org/network/kdeconnect-kde/-/commit/393624af9c6cf1af8bf2b912a4acaeb06abdbb40
Comment 7 Albert Vaca Cintora 2023-09-06 02:50:24 UTC
I just pushed a fix for this. The fix is on the desktop side, so it will have to wait until the next release for Windows to be available to users. Sorry for having this broken for so long and thanks for all the info you provided about the bug, which helped find the issue.
Comment 8 Kurt.Hornik@wu.ac.at 2023-09-06 04:26:13 UTC
Thanks.  I actually use gsconnect on Debian GNU/Linux, so likely things will not change for me?
Comment 9 samuelsmash 2023-09-06 23:40:38 UTC
(In reply to Albert Vaca from comment #6)
> Git commit 393624af9c6cf1af8bf2b912a4acaeb06abdbb40 by Albert Vaca Cintora.
> Committed on 06/09/2023 at 04:45.
> Pushed by albertvaka into branch 'release/23.08'.
> 
> Fix SFTP plugin on Windows
> 
> Broken by
> https://invent.kde.org/network/kdeconnect-android/-/merge_requests/320
> 
> (cherry picked from commit 4d5474db7bc2a573063415ff3e9156a605b67794)
> 
> M  +9    -1    plugins/sftp/sftpplugin-win.cpp
> 
> https://invent.kde.org/network/kdeconnect-kde/-/commit/
> 393624af9c6cf1af8bf2b912a4acaeb06abdbb40

Will this also fix the issue on arch linux? Since that's where I use kdeconnect.
Comment 10 Albert Vaca Cintora 2023-09-11 02:55:00 UTC
No, this change is specific for Windows. In Arch it should work fine (I use Arch) with the latest version of kdeconnect. Open a separate issue if it doesn't.
Comment 11 samuelsmash 2023-09-11 02:59:52 UTC
(In reply to Albert Vaca from comment #10)
> No, this change is specific for Windows. In Arch it should work fine (I use
> Arch) with the latest version of kdeconnect. Open a separate issue if it
> doesn't.

This very report that I opened was because since version 1.24 of kdeconnect filesystem expose does not work! No idea why windows was even mentioned.
Comment 12 samuelsmash 2024-03-08 11:38:11 UTC
(In reply to Albert Vaca Cintora from comment #10)
> No, this change is specific for Windows. In Arch it should work fine (I use
> Arch) with the latest version of kdeconnect. Open a separate issue if it
> doesn't.

I found a solution for the issue after all these months. 

I just needed to add /storage/emulated/0 to the end of the address, kdeconnect is trying to read the actual root of the phone which resulted in all these issues wtf. 

The fact that it tries to do that makes it a bug as well.