-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GSConnect cannot send multiple files at once #1025
Comments
Thanks for reporting. Looks like concurrent packets sent from |
GSconnect seems to be sending multiple files one by one. On the other hand, if I send two files from a device's KDE connect, the receiving device notifies me once for the two files that it has received two files, rather than notifying for each file. Should GSconnect send multiple files in one session? |
I'm not sure what you mean exactly, but that sounds like a different issue. |
@andyholmes , this still is not resolved. I am having issues on the latest versions. First file goes through, not the rest |
Correct, you can consider all open issues unresolved 🙂 I don't use GSConnect myself anymore and don't really contribute much code for that reason. A fix for this will probably have to come from the community. |
Mmm, I see now. KDEConnect has a The multiple files are transferred as separate network packets, just as we're doing, but without that preceding {
"numberOfFiles": 2,
"totalPayloadSize": 12345678
} ...each file gets treated separately, instead of as a group. And I don't see any sign of Edit: Oh, and each packet of the group is also supposed to have the Edit2: I have some really ugly code for doing multi-file sends in my fork's But I'll probably put that aside until my development machine is similarly upgraded, so I can work on it more comfortably and get it cleaned up. IOW, don't expect an imminent PR, at least not quite yet. |
Yeah, that's not really the root of the problem here, although it would help. The real problem here is that I put the packet queue in In practice, the device channel must write packets to itself to negotiate an auxiliary stream (i.e. file transfer), so it's hitting If I were to do it again it would just be a traditional callback loop over an array. Trying to "add" performance and simplicity here backfired and ended up hiding what is probably the cause of 99% of the heisenbugs in GSConnect. |
@andyholmes Ah, I see. So the issue is contention even before getting to the I did notice that, on that auxiliary channel, the To handle the multi-file thing cleanly, I was thinking it'd be best to split (Right now I have If a WDYT? |
It's been awhile since I looked at the composite transfer code. I believe it goes something like:
IIRC, there can never be more than one composite transfer at once (in a given direction). The transfer object will hang around and just keep having files appended to it, until all files complete. Non-file transfer shouldn't interrupt file transfers, since they're distinguished by the Having separate classes for upload/download groups makes sense, but I think the transfers themselves can be determined based on whether |
Also, keep in mind there will still need to be a "vanilla" transfer for notification icons, etc. |
This is happening to me on Ubuntu 22.04 LTS. |
This issue is present on Ubuntu 23.04 also. First file goes others dont. |
The most recent time I used it, it seems to have worked as intended just sending all files. Strange. |
I am having the same issue and wanted to report this but found this issue instead. It works from the Android KDE connect app to GSConnect but not from GSConnect to Android. I am on Ubuntu 22.04. |
I have the same bug If I send single file, it work correct. Repair it please. Thank you very much |
This issue is still present on Ubuntu 24.04 Bug is nearly 4 years old now! ;) |
Yes, no work has been done on this issue. I learned to use zip files instead... |
So I've dusted off my branch and started updating it to the current code base (which has evolved significantly since the code I have so far was written). Still no promises regarding timeframe, but I'm hoping to get multiple file sending working from both the user menu and the file manager extension, plus directory transfers via temporary So, ideally if it all works the way I'm hoping, you could select three files and two directories in Nautilus, and the "Send to Device" action would do a 5-file transfer to the receiving device. Still no progress reporting, so you wouldn't want to use it for big payloads. Stay tuned. Maybe. 😉 |
That is great news, will gladly test when ready. Good luck |
That would be a file-manager-only feature, BTW, as it'd be leveraging Python's |
My Somewhere along the way, however, I managed to break single-file transfers, so I don't recommend using it yet unless you're willing to always transfer at least 2 files/directories at a time from Nautilus, and not use the "Send file" option of the device menu at all. (At least, I assume the latter is broken as well. I haven't tested it.) Other caveats:
|
Did you consider using a streaming implementation for zip files? This should solve most of the problems. A quick googling lead me to https://pypi.org/project/stream-zip/. |
@darkdragon-001 Interesting thought, but ultimately it's not the Python code sending the data. That's done in the JavaScript code. And in multi-file transfers, it needs to send an update packet containing the item count and total file size for the transfer, I think it would be a tricky thing to pull off. Streaming makes more sense for a large single-file transfer, not as much when you're sending multiple files (without some container format). Plus, like I said, it's just a terrible idea to be sending enormous amounts of data over the KDEConnect file-transfer link. Rather than attempting to eliminate any barriers to doing that, my inclination is to lean in to them instead. Even the naming thing, I don't think is a really serious restriction. Why would anyone want to simultaneously transfer two folders both named "Pictures" to their phone? (And to be clear, this is only about conflicts in the SAME transfer operation, and it's only about the top-level names. The directories — and therefore the zip files — being transferred can contain files/directories with the same name, they just can't have the same name.) I could generate random unique names for the zip files (in fact, my first version did just that), but that gets confusing because they'll have that name when they're stored on the other end of the link. It's not like the Android device will extract or rename them automatically. So the filenames matter, because they're visible to the user. I'll probably write some code to do "Pictures (1).zip"-style renaming, in case of conflicts, even though I already feel kind of like it's a solution looking for a problem. |
For the naming: you could just compress the folder as well. So even when the archive has a random name, once it is decompressed, you will have the original folder name back. |
Already doing that, but I still don't think people will appreciate transferring folders only to end up with filenames like Yes, I could name them all something that contained the folder name along with a random identifier, but that's no easier than just renaming only the (rare) conflicts to |
And apparently I should stop, because at least Samsung's file manager defaults to extracting
Anyway, I've pushed commits to handle conflict-renaming and fix single-file transfers, so the branch is now usable for testing. |
In fact, it's close enough now that I'll open a PR, so people can review and comment on the code there. |
I have made all possible tests and LGTM. Thank you very much, it is totally usable |
Thanks @jakubklos77 ! I've been running with this build for a few days now, and while I don't do a LOT of file transfers, the ones I've performed as tests also seem fine. I just need to sort out what about this change breaks the automated tests, and fix it. Then the PR should be in good shape to merge. |
I am not a coder, just a humble user of GSConnect. I had the same problem (i.e. of not being able to send more than single files). I thought it was JUST ME so having just discovered this thread I realise it's affecting all users. |
The change would only affect the file manager plugins (Nautilus and Nemo), updates to the Firefox extension wouldn't affect it. Once the fix is incorporated (meaning, when PR #1821 first exits draft status, and then is merged into the repo), you'd have two choices: If you want to get the fix installed as soon as possible, you could manually install a build of GSConnect that includes that change. (There's some information in the project wiki about how to do that, and we can steer you in the right direction if you want to go that route.) Or, you can wait until the next release of GSConnect, which will then be published to extensions.gnome.org and it'll be auto-updated on your system... assuming you're currently running with it installed from there to your user account. (By that I mean, some Linux distros package GSConnect as a system package, installed through their system package manager. For users of those packages, the update would have to come from the same source, and it'd also be installed using the system's packaging tool — All of that also assumes you're running on a system with GNOME 46 and the latest GSConnect, which is currently v57. If you're using an older LTS distro with GSConnect v56 or lower, those versions are no longer supported so there won't be a compatible extension update. (GNOME 46 brought sweeping changes to the extension system, so the current extension code — which is where the fix would be made — can no longer run on any earlier GNOME releases.) |
(Oh, and if you are on an older GNOME release, just for fun those steps will probably be slightly different.) |
@ferdnyc Whatever I did, things now are working very harmoniously. I power off both my laptop and phone each evening and have had to force myself to remember the sequence of actions I need to follow to reconnect my paired laptop and Android phone. I actually use the Extension Manager app on my laptop to reconnect the paired devices. So, because I am a bit confused, I think I shall try to go the automatic update option. That is, sit back and see if the auto update happens. UPDATE: |
Believe me, I sympathize. It's a complex series of moving parts that makes this stuff work (when it even does!), and the fact that things keep changing behind the scenes — at different speeds for everyone — only further muddies everything. Case in point: Extensions was in sort of a nascent state in GNOME 42, and particularly in Ubuntu 20.04. It wasn't installed by default or included on the Live USB apparently... local extension-management was sort of mid-migration from GNOME Tweaks to the new, dedicated app when 20.04 released. By GNOME 44 or 45 the transition to Extensions was complete, Tweaks had dropped the overlapping functionality, and Extensions had become more robust than its initial versions. Extension Manager is also a solid, third-party tool, which strongly inspired the official Extensions app, and predates it. It's far more capable than the proto-Extensions app on those earlier systems, as you've discovered. 24.04 will indeed bring GNOME 46, and compatibility with current GSConnect releases (and future, at least until we find out if GNOME 47 forces any new compatibility breakage). |
@ferdnyc |
Describe the bug
GSConnect cannot send multiple files at once. If I try sending multiple files to my phone, only one file is received by my phone.
GSConnect shows "Transfer Successful" notification only for the first file, and "Transferring File" notifications for the other files remain.
Steps To Reproduce:
Expected behavior
Support Log
System Details (please complete the following information):
GSConnect environment (if applicable):
Additional Notes:
Sharing multiple files between my two phones and from one of my phone to GSConnect works well.
The text was updated successfully, but these errors were encountered: