v6: OffsetDateTime is serialised with toString(), which drops the seconds and is not RFC 3339
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Xác định Filter$DateOperand, InsertManyRequest.marshalValue và DateUtil$CustomTypeAdapterFactory$1, là ba điểm vào tuần tự hóa được mô tả trong issue. Tái hiện các trường hợp timestamp được làm tròn đến phút cho các thao tác chèn REST, các batch gRPC và các bộ lọc ngày, sau đó xác minh rằng cả ba đường dẫn đều phát ra timestamp RFC 3339 có giây và rằng các thao tác ghi và bộ lọc chấp nhận chúng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The client serialises OffsetDateTime with toString(), which omits the seconds when they are zero. 2024-03-01T00:00:00Z therefore goes on the wire as 2024-03-01T00:00Z, which is not RFC 3339 — partial-time requires hour ":" minute ":" second — and Weaviate rejects it.
Every timestamp on an exact minute boundary is affected, which is most timestamps written by hand. It breaks writes and filters alike.
Reproduction
OffsetDateTime round = OffsetDateTime.parse("2024-03-01T00:00:00Z");
OffsetDateTime withSeconds = OffsetDateTime.parse("2024-03-01T00:00:01Z");
System.out.println(round); // 2024-03-01T00:00Z <- the seconds are gone
System.out.println(withSeconds); // 2024-03-01T00:00:01Z
Against a collection with a single date property when:
FAIL REST insert round -> invalid date property 'when' on class 'DBeaverDateProbe':
requires a string with a RFC3339 formatted date,
but the given value is '2024-03-01T00:00Z'
OK REST insert withSeconds
FAIL gRPC batch round -> invalid date property 'when' on class 'DBeaverDateProbe':
requires a string with a RFC3339 formatted date,
but the given value is '2024-03-01T00:00Z'
OK gRPC batch withSeconds
and on the query side:
FAIL Filter.property("when").gt(round) -> trying parse time as RFC3339 string:
parsing time "2024-03-01T00:00Z" as
"2006-01-02T15:04:05Z07:00": cannot parse "Z" as ":"
OK Filter.property("when").gt(withSeconds) -> 2 rows
OK Filter.property("when").gt("2024-03-01T00:00:00Z") // String overload -> 2 rows
FAIL Filter.createdAt().gt(round) -> same parse error
OK Filter.createdAt().gt(withSeconds)
The only difference between each passing and failing pair is whether the second happens to be zero, which isolates the cause.
Where it comes from
Disassembling every non-protocol class in client6-6.3.1-all.jar and grepping for java/time/OffsetDateTime.toString gives three call sites, one per path:
| class | path | reached by |
|---|---|---|
Filter$DateOperand |
gRPC search | every date filter, plus Filter.createdAt() / Filter.lastUpdatedAt() |
InsertManyRequest.marshalValue |
gRPC batch | data.insertMany(...) — Value.newBuilder().setStringValue(dt.toString()) |
DateUtil$CustomTypeAdapterFactory$1 |
REST / Gson | data.insert(...) and object reads — JsonWriter.value(dt.toString()) |
OffsetDateTime.toString() delegates down to LocalTime.toString(), which emits HH:mm when both second and nano are zero. It is a display format, not a wire format.
Suggested fix
Format explicitly at all three sites instead of calling toString() — for example DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX"), or ISO_OFFSET_DATE_TIME applied to a value normalised to at least second precision, so the seconds are always present.
Workaround, and where there isn't one
For filters on a property, pass the RFC3339 String rather than an OffsetDateTime: Filter.property(p).gt("2024-03-01T00:00:00Z") takes the String overload and works (shown above).
There is no workaround on the metadata path — Filter.createdAt() and Filter.lastUpdatedAt() return DateProperty, whose comparison methods accept OffsetDateTime only. Same for writes, where the property map value has to be an OffsetDateTime to be recognised as a date at all.
Version
- java-client 6.3.1
- Weaviate 1.39.0
- Ngôn ngữ chính
- Java
- Star
- 34
- Fork
- 29
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 weaviate/java-client
-
v6: ShardReplica.shardName has no @SerializedName, so the shard is always nullCó thể đã có người làm @dudanogueira đã nhận 30 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
weaviate/java-client#621 ·
-
v6: Shard.vectorQueueLenght is misspelled, so the vector queue length is always 0Có thể đã có người làm @dudanogueira đã nhận 30 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
weaviate/java-client#619 ·
-
v6: tenant updates are not split at the server's 100-tenant limit, so activate/deactivate fails above 100Có thể đã có người làm @dudanogueira đã nhận 42 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
weaviate/java-client#615 ·
-
v6: NvidiaReranker sends "baseUrl"; the module reads "baseURL"Có thể đã có người làm @dudanogueira đã nhận 46 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
weaviate/java-client#607 ·
-
v6: rerank cannot be used with BM25, Hybrid or FetchObjectsCó thể đã có người làm @dudanogueira đã nhận 46 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
weaviate/java-client#603 ·
Tất cả issue của weaviate/java-client
Issue tương tự
-
enhancement good first issue
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 66/100
apache/fineract-consumer-facing#175 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] 订单:会员凭订单号即可取消其他会员的待付款订单(取消接口不校验订单归属)Có thể đã có người làm @dadiyang đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
macrozheng/mall#1016 ·
-
[Bug] The producer summary counts an unreported client version as a second version and warns about a version mixCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
apache/rocketmq-dashboard#6110 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Feature:Resolution
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
intellij-elixir/intellij-elixir#4396 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Python 3.15 supportCó thể đã có người làm @amnesiaof đã nhận hôm nay. Đang mởL: python L: python:uv
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dependabot/dependabot-core#16524 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày