Timestamps from the API seem to get deserialized wrongly
还没有人认领这个 Issue。
评估
调研方向
从 SDK 用于反序列化 V2 API 响应的 objectMapper 入手,然后使用 UpdateUsersRequest 示例以及返回的 createdAt 和 updatedAt 字段重现该问题。确认 API 使用的时间单位,并验证微秒时间戳会转换为正确的日期,而不是生成年份 55808194。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Java
- 星标
- 3
- 派生
- 2
- 平均合并
- 4 小时 31 分钟
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GetStream/stream-sdk-java 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 45/100
GetStream/stream-sdk-java#108 ·
-
难度 3/5 1-2 天 新手友好度 45/100
GetStream/stream-sdk-java#30 ·
查看 GetStream/stream-sdk-java 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
Dans-Plugins/Medieval-Roleplay-Engine#396 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
LtByXsl throws NoSuchElementException when defect element has no text content可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
objectionary/lints#1640 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 72/100
virtualcell/vcell#2193 ·
维护者通常 1 天内回复