Skip to content
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

[KDESKTOP-1262] Do not force VFS status after upload session abortion #489

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/libsyncengine/jobs/abstractjob.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class AbstractJob : public Poco::Runnable {

virtual void abort();
bool isAborted() const;
bool hasVfsForceStatusCallback() const noexcept { return _vfsForceStatus != nullptr; };

[[nodiscard]] inline bool bypassCheck() const { return _bypassCheck; }
inline void setBypassCheck(bool newBypassCheck) { _bypassCheck = newBypassCheck; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,10 @@ bool DriveUploadSession::handleCancelJobResult(const std::shared_ptr<UploadSessi

return true;
}

void DriveUploadSession::abort() {
AbstractUploadSession::abort();
setVfsForceStatusCallback(nullptr);
}

} // namespace KDC
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class DriveUploadSession : public AbstractUploadSession {
inline const NodeId &nodeId() const { return _nodeId; }
inline SyncTime modtime() const { return _modtimeOut; }

void abort() override;

protected:
bool handleStartJobResult(const std::shared_ptr<UploadSessionStartJob> &StartJob, std::string uploadToken) override;
bool handleFinishJobResult(const std::shared_ptr<UploadSessionFinishJob> &finishJob) override;
Expand Down
2 changes: 2 additions & 0 deletions test/libsyncengine/jobs/network/testnetworkjobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,8 @@ void TestNetworkJobs::testDriveUploadSessionSynchronousAborted() {
Utility::msleep(1000); // Wait 1sec

DriveUploadSessionJob->abort();
CPPUNIT_ASSERT(!DriveUploadSessionJob->hasVfsForceStatusCallback());


Utility::msleep(1000); // Wait 1sec

Expand Down
Loading