kreds icon indicating copy to clipboard operation
kreds copied to clipboard

ERR syntax error on SetOption ULong options

Open istarion opened this issue 2 years ago • 1 comments

SetOption throws KredsRedisDataException every time I use ULong options. Example:

newClient(Endpoint.from("127.0.0.1:${redis.firstMappedPort}")).use { client ->
    client.set("key", "val", SetOption.Builder(exSeconds = 30u).build())
...
ERR syntax error
io.github.crackthecodeabhi.kreds.protocol.KredsRedisDataException: ERR syntax error
	at app//io.github.crackthecodeabhi.kreds.protocol.CommandProcessor.decode(Command.kt:69)
	at app//io.github.crackthecodeabhi.kreds.connection.AbstractKredsClient$execute$suspendImpl$$inlined$withReentrantLock$2.invokeSuspend(ExclusiveObject.kt:49)
	(Coroutine boundary)
	at io.github.crackthecodeabhi.kreds.connection.AbstractKredsClient.execute$suspendImpl(Client.kt:151)

client.expire("key", 30u) works without issues.

Library version: 0.7 Redis server: redis:6.2.7-alpine Kotlin 1.6.10

istarion avatar Apr 28 '22 13:04 istarion

@istarion thanks for reporting, right now, the work around is as your described, using expire command explicitly.

I have marked this to be fixed in 0.8 release.

crackthecodeabhi avatar May 01 '22 12:05 crackthecodeabhi

Fixed in https://github.com/crackthecodeabhi/kreds/pull/31

crackthecodeabhi avatar Sep 18 '22 20:09 crackthecodeabhi