refactor: leverage new dependency features from recent updates (#5057)

This commit is contained in:
James Rich 2026-04-10 17:51:08 -05:00 committed by GitHub
parent 929e273978
commit 9c8532f80d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 47 additions and 57 deletions

View file

@ -18,6 +18,7 @@ package org.meshtastic.core.database
import androidx.room3.TypeConverter
import co.touchlab.kermit.Logger
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json
import okio.ByteString
import okio.ByteString.Companion.toByteString
@ -33,10 +34,12 @@ import org.meshtastic.proto.User
@Suppress("TooManyFunctions")
class Converters {
@OptIn(ExperimentalSerializationApi::class)
private val json = Json {
isLenient = true
ignoreUnknownKeys = true
encodeDefaults = true
exceptionsWithDebugInfo = false
}
@TypeConverter fun dataFromString(value: String): DataPacket = json.decodeFromString(DataPacket.serializer(), value)