Timestamps from the API seem to get deserialized wrongly
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
調査の方向性
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分
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 6 日以内に返信
-
type: dependency-upgrade
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
spring-projects/spring-session#4156 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
quarkiverse/quarkus-langchain4j#3127 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
HotswapProjects/HotswapAgent#688 ·