Timestamps from the API seem to get deserialized wrongly
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comienza con el objectMapper que utiliza el SDK para deserializar las respuestas de la API V2 y, después, reproduce el problema utilizando el ejemplo de UpdateUsersRequest y los campos devueltos createdAt y updatedAt. Confirma la unidad de tiempo utilizada por la API y verifica que las marcas de tiempo en microsegundos se conviertan en las fechas correctas en lugar de producir el año 55808194.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I will just lead with some example code (it's kotlin, hope its okay, but the gist should be clear)
fun main() {
val client = StreamSDKClient()
val updateUsersRequest = UpdateUsersRequest().apply {
users = mapOf("test" to UserRequest().apply {
id = "tester"
name = "Tester"
})
}
client.updateUsers(
updateUsersRequest
).execute().data.users.forEach {
println(it)
}
}
The output looks like this:
tester=FullUserResponse(banned=false, createdAt=Thu May 22 23:25:49 CEST 55808194, id=tester, invisible=false, language=, online=false, role=user, shadowBanned=false, totalUnreadCount=0, unreadChannels=0, unreadCount=0, unreadThreads=0, updatedAt=Thu May 22 23:25:49 CEST 55808194, blockedUserIds=[], channelMutes=[], devices=[], mutes=[], teams=[], custom={}, avgResponseTime=null, banExpires=null, deactivatedAt=null, deletedAt=null, image=null, lastActive=null, name=Tester, revokeTokensIssuedBefore=null, latestHiddenChannels=null, privacySettings=null, teamsRole=null)
As you see, the date is completely off: createdAt=Thu May 22 23:25:49 CEST 55808194 which is (roughly, maybe due to precission issues) the value if you multiply the current timestamp with 1e6.
The reasons seems to be that the V2 api responds with timestamps in microseconds resulution (e.g. 1761074344387549000), but the objectMapper the SDK is using to deserialize the response is not configured to understand these timestamps.
It's not a grave issue for us since we are not using this timestamp. I just noticed and thought I should share.
- Lenguaje dominante
- Java
- Estrellas
- 3
- Forks
- 2
- Merge medio
- 4 h 31 min
- PR fusionados (30 d)
- 6
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de GetStream/stream-sdk-java
-
Daily integration run is redAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
GetStream/stream-sdk-java#108 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
GetStream/stream-sdk-java#30 ·
Todos los issues de GetStream/stream-sdk-java
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Dans-Plugins/Medieval-Roleplay-Engine#396 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
LtByXsl throws NoSuchElementException when defect element has no text contentPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
objectionary/lints#1640 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
virtualcell/vcell#2193 ·
Los mantenedores suelen responder en 1 día