jessewilson
10/03/2020, 10:42 AMzalewski.se
10/05/2020, 1:49 AM1.3.0
to 1.4.3
my tests started throwing:
kotlin.Exception: android/database/sqlite/SQLiteException - no such table: location (code 1): , while compiling: INSERT INTO location VALUES (?, ?, ?, ?, ?, ?)
Have anyone faced problem like this?
Also I noticed that now sqldelight auto-generates data classes
instead of interfaces
, what’s the reason behind this change?alec
10/05/2020, 12:58 PMMiSikora
10/05/2020, 8:53 PMClassName
that is i.e. String
can I somehow use it to create String::class.java
?
The best I found is ("%L::class.java", className.canonicalName)
but I’d like to use a simple name that will be in the import list.jw
10/05/2020, 8:54 PM%T
to get an import along with just passing className
MiSikora
10/05/2020, 8:54 PMMiSikora
10/05/2020, 8:59 PM("%T as %T", sourcedWith, featureType)
generates this override val sourcedWith: Class<Feature<*>> = <http://com.my|com.my>.CustomFeature as Class<Feature<*>>
And I want override val sourcedWith: Class<Feature<*>> = CustomFeature::class.java as Class<Feature<*>>
jw
10/06/2020, 1:37 PM::class.java
part after %T
. I just meant that %T
will handle importing for youColton Idle
10/06/2020, 2:25 PM@Field("password") password: String
I'm using charles to inspect the request, and I don't see it in the URL there, it seems to be part of the request body, but not sure. My backend team says that they see someone sending it in the url as a param.jw
10/06/2020, 2:28 PMColton Idle
10/06/2020, 2:31 PMColton Idle
10/07/2020, 8:20 PMjw
10/08/2020, 3:05 AMjw
10/08/2020, 3:06 AMyshrsmz
10/09/2020, 7:40 AMalec
10/09/2020, 12:19 PMalec
10/09/2020, 12:19 PMMaurice Jouvet
10/27/2020, 10:10 AM@Serializable
data class AccessModel(
val isAccessible: Boolean = false,
val conditions: List<ConditionModel>? = null
)
@Serializable
data class ConditionModel(
val id: Int,
val value: List<String>? = null,
val min: Float? = null,
val max: Float? = null
)
It's crashing here:
bindString(1, visibility?.let { database.FieldAdapter.accessModelAdapter.encode(it) })
fun accessModelToString(item: AccessModel): String = Json.encodeToString(AccessModel.serializer(), item)
val accessModelAdapter = object : ColumnAdapter<AccessModel, String> {
override fun encode(value: AccessModel): String = SharedJSONConverter.accessModelToString(value)
}
Here the object that's crashing.
{"conditions":[{"id":321,"value":["40"]}]}
Thread in Slack ConversationSiggi Gunnarss
10/27/2020, 3:34 PMflorent
11/01/2020, 12:53 AMchris-horner
11/10/2020, 2:45 AMCipherSource
and CipherSink
to encrypt the JSON on disk.
From what I can tell, it's probably me misusing Okio. I'm attempting to save the Cipher's initialisation vector into a Sink
before then converting that into a CipherSink
. This ends up looking like:
fun getEncryptedSink(output: OutputStream): Sink {
val cipher = getEncryptionCipher()
return output.sink().buffer().use {
it.writeInt(cipher.iv.size)
it.write(cipher.iv)
it.buffer.cipherSink(cipher)
}
}
The reason I want to write the IV to disk is so I can use it to construct a decryption cipher on the way back out:
fun getDecryptedSource(input: InputStream): Source {
return input.source().buffer().use {
val ivSize = it.readInt().toLong()
val iv = it.readByteArray(ivSize)
val cipher = getDecryptionCipher(iv)
it.cipherSource(cipher)
}
}
But this approach makes DataStore extremely unhappy, crashing when it attempts to write the data to disk. Specifically, a call to
stream.fd.sync()
fails.
Anyone know what's wrong with my approach?jw
11/10/2020, 2:46 AMuse
use closes the sink before it's returnedjw
11/10/2020, 2:48 AMjw
11/10/2020, 2:49 AMreturn output.sink().buffer().let {
// write into the BufferedSink's buffer
it.buffer.writeInt(cipher.iv.size)
it.buffer.write(cipher.iv)
// return a CipherSink around the BufferedSink
it.cipherSink(cipher)
}
Bruce Xia
11/10/2020, 7:53 PMclass LayoutConfigResolver @Inject constructor(private val context: Context, private val deviceInfo: DeviceInfo) {
fun currentConfig() = when {
deviceInfo.isTv -> TV
else -> if (context.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) PHONE_PORTRAIT else PHONE_LAND
}
}
saket
11/10/2020, 8:36 PMsaket
11/10/2020, 8:36 PMsaket
11/10/2020, 8:39 PM// In your dependency graph
val colorPalette = if (deviceInfo.isTv) draculaTheme() else solarizedLightTheme()
// In your layouts
textView.setTextColor(colorPalette.heading)
Bruce Xia
11/10/2020, 9:58 PMchris-horner
11/12/2020, 2:27 AMCipherSink
with DataStore. They now explicitly forbid closing the provided OutputStream
, which I believe CipherSink
needs to do in order to invoke its doFinal()
.
https://android-review.googlesource.com/c/platform/frameworks/support/+/1464603