Timestamps from the API seem to get deserialized wrongly
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu với objectMapper được SDK sử dụng để deserialize các phản hồi API V2, sau đó tái hiện vấn đề bằng ví dụ UpdateUsersRequest và các trường createdAt và updatedAt được trả về. Xác nhận đơn vị thời gian được API sử dụng và kiểm tra rằng các timestamp tính bằng microsecond được chuyển đổi thành đúng ngày tháng thay vì tạo ra năm 55808194.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 3
- Fork
- 2
- Merge trung bình
- 4 giờ 31 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của GetStream/stream-sdk-java
-
Daily integration run is redĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
GetStream/stream-sdk-java#108 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
GetStream/stream-sdk-java#30 ·
Tất cả issue của GetStream/stream-sdk-java
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Dans-Plugins/Medieval-Roleplay-Engine#396 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
objectionary/lints#1640 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
virtualcell/vcell#2193 ·
Maintainer thường phản hồi trong vòng 1 ngày