TransferJob: fix for when the readChannelFinished has already been emitted before start is called()
ClosedPublic

Authored by aacid on Dec 4 2017, 11:19 PM.

Details

Summary

This fixes a regression by the removal of the busy loop call from bcdbe62660a9ca91b0d15f3a9a06a758ec8fdcda

BUG: 386246

Test Plan

New test passes with the new code, didn't pass before
Sending very small files with kde connect works again

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
aacid created this revision.Dec 4 2017, 11:19 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 4 2017, 11:19 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
aacid requested review of this revision.Dec 4 2017, 11:19 PM
anthonyfieroni added inline comments.
src/core/transferjob.cpp
316–329

It looks very weird to me even with single invocation call. Does it better to connect outgoing source early, when we know that job is async?

I'm sorry, but this does not resolve https://bugs.kde.org/show_bug.cgi?id=386246 for me. KDE Connect's FileTransferJob does not even use KIO's TransferJob. It just extends KJob, so it could be a (similar) bug there.

aacid added a comment.Dec 5 2017, 3:25 PM

I'm sorry, but this does not resolve https://bugs.kde.org/show_bug.cgi?id=386246 for me. KDE Connect's FileTransferJob does not even use KIO's TransferJob. It just extends KJob, so it could be a (similar) bug there.

Yes it does. You don't know it but
m_reply = Daemon::instance()->networkAccessManager()->put(req, m_origin.data());
in filetransferjob.cpp is using kio.

Are you sure you know how to run kdeconnect with the patched kio to say this doesn't fix the problem for you?

Yes it does. You don't know it but
m_reply = Daemon::instance()->networkAccessManager()->put(req, m_origin.data());
in filetransferjob.cpp is using kio.

I really didn't know that

Are you sure you know how to run kdeconnect with the patched kio to say this doesn't fix the problem for you?

I included a qCDebug(KIO_CORE) << "FooBar"; after the patched section and when I start the KDE Connect daemon from the Konsole I can see it in the output.

aacid updated this revision to Diff 23941.Dec 14 2017, 11:00 PM
aacid retitled this revision from TransferJob: workaround for when the readChannelFinished has already been emitted to TransferJob: fix for when the readChannelFinished has already been emitted before start is called().
aacid removed subscribers: anthonyfieroni, nicolasfella.

connect to the slot earlier as suggested by Anthony Fieroni

Sorry guys i unsubscribed you by mistake when updating the summary.

Nicolas can you check if this fixes it for you? It does for me.

In D9190#179713, @aacid wrote:

Sorry guys i unsubscribed you by mistake when updating the summary.

Nicolas can you check if this fixes it for you? It does for me.

Will do on Monday

Now it does. Awesome!

apol accepted this revision.Dec 19 2017, 11:18 AM

LGTM

This revision is now accepted and ready to land.Dec 19 2017, 11:18 AM
dfaure accepted this revision.Dec 19 2017, 11:38 AM

This indeed seems more logical than the previous version of the patch. Thanks.

aacid closed this revision.Dec 19 2017, 11:00 PM
This revision was automatically updated to reflect the committed changes.