Skip to content

Commit

Permalink
Merge pull request #2532 from nextcloud/bugfix/2519/file_upload
Browse files Browse the repository at this point in the history
File upload always fails for 1MB+
  • Loading branch information
mahibi authored Oct 28, 2022
2 parents b641121 + 8dd6fe1 commit 037e0b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,13 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
notification = mBuilder!!
.setContentTitle(failureTitle)
.setContentText(failureText)
.setOngoing(false)
.build()

mNotifyManager!!.notify(notificationId, notification)
// Cancel original notification
mNotifyManager?.cancel(notificationId)
// Then show information about failure
mNotifyManager!!.notify(SystemClock.uptimeMillis().toInt(), notification)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import com.nextcloud.talk.utils.Mimetype
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import okhttp3.MediaType
import okhttp3.OkHttpClient
import okhttp3.Protocol
import okhttp3.Response
import java.io.File
import java.io.IOException
Expand Down Expand Up @@ -290,6 +291,7 @@ class ChunkedFileUploader(
okHttpClientBuilder.followRedirects(false)
okHttpClientBuilder.followSslRedirects(false)
// okHttpClientBuilder.readTimeout(Duration.ofMinutes(30)) // TODO set timeout
okHttpClientBuilder.protocols(listOf(Protocol.HTTP_1_1))
okHttpClientBuilder.authenticator(
RestModule.MagicAuthenticator(
ApiUtils.getCredentials(
Expand Down

0 comments on commit 037e0b3

Please sign in to comment.