Skip to content

Commit 309687e

Browse files
authored
PushRegistrationManager: fix repeated sending of requests (#2082)
* Update PushRegistrationManager to use TextContent for POST requests (closes #2073) * Replace ByteReadChannel with TextContent in PushRegistrationManager * Update bitfire-dav4jvm dependency to 30472e34d6 * Update bitfire-dav4jvm dependency to a8acbff310
1 parent bbb200c commit 309687e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

core/src/main/kotlin/at/bitfire/davdroid/push/PushRegistrationManager.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ import dagger.hilt.android.qualifiers.ApplicationContext
3434
import io.ktor.client.HttpClient
3535
import io.ktor.http.HttpHeaders
3636
import io.ktor.http.Url
37+
import io.ktor.http.content.TextContent
3738
import io.ktor.http.isSuccess
38-
import io.ktor.utils.io.ByteReadChannel
3939
import kotlinx.coroutines.CoroutineDispatcher
4040
import kotlinx.coroutines.sync.Mutex
4141
import kotlinx.coroutines.sync.withLock
@@ -261,8 +261,7 @@ class PushRegistrationManager @Inject constructor(
261261
serializer.endDocument()
262262

263263
DavCollection(httpClient, collection.url.toKtorUrl()).post(
264-
{ ByteReadChannel(writer.toString()) },
265-
DavResource.MIME_XML_UTF8
264+
TextContent(writer.toString(), DavResource.MIME_XML_UTF8)
266265
) { response ->
267266
if (response.status.isSuccess()) {
268267
// update subscription URL and expiration in DB

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ androidx-test-rules = "1.7.0"
1919
androidx-test-junit = "1.3.0"
2020
androidx-work = "2.11.1"
2121
bitfire-cert4android = "035dd99f7f"
22-
bitfire-dav4jvm = "77c5069f53"
22+
bitfire-dav4jvm = "a8acbff310"
2323
bitfire-synctools = "e9ff9948e3"
2424
compose-accompanist = "0.37.3"
2525
compose-bom = "2026.03.00"

0 commit comments

Comments
 (0)