BReg refuses valid crs84-point coordinates near zero at precision 6 or more
Maintainer thường phản hồi trong vòng 1 ngày
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
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start with coordinate_number in crates/registry-breg/src/contract.rs and the client validator in crates/registry-breg-client/src/actions.rs; compare their decimal handling with the polygon path added in #2644. Add near-zero Point and polygon position cases to both validators and update the assertion that currently expects the precision 9 coordinate to be refused. Done when in-bounds values with no more than the configured fraction digits are accepted consistently by server and client validation.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A crs84-point field with precision 6 or more refuses some valid coordinates close to zero, that is, points within roughly 1e-5 degrees (about 1 m) of the equator or the prime meridian. Programme areas on the equator (for example Kenya, Uganda, DRC, Gabon, Ecuador, Indonesia) can hit it.
Cause
coordinate_number in crates/registry-breg/src/contract.rs formats the JSON number with Value::to_string() and passes the text to parse_coordinate, which refuses any exponent (e or E). serde_json writes small magnitudes in exponent form, so 0.000000001 reaches the parser as 1e-9 and is refused even though it has 9 fraction digits and is inside the bounds.
The client-side validator in crates/registry-breg-client/src/actions.rs behaves the same way; the polygon test added in #2644 asserts that [0.000000001, 0.000000001] is refused at precision 9, which pins this behaviour.
Expected
A coordinate is accepted when its value is within bounds and it has no more fraction digits than precision, however serde_json prints it.
Suggested fix
Read the value with as_f64 and count fraction digits from a non-exponent decimal rendering (the polygon path added in #2644 already avoids the exponent problem), and keep refusing exponent notation only where it comes from the submitted text, if that is still wanted. Relax the assertion in actions.rs and add near-zero cases for Point and polygon positions on both the server and client validators.
- Ngôn ngữ chính
- Rust
- Star
- 2
- Fork
- 0
- Merge trung bình
- 9 giờ 48 phút
- Pull request đã merge (30 ngày)
- 151
Chuẩn bị môi trường
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 registrystack/registry-stack
-
area:breg enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
registrystack/registry-stack#2765 ·
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 62/100
registrystack/registry-stack#2761 ·
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 70/100
registrystack/registry-stack#2743 ·
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 76/100
registrystack/registry-stack#2706 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
macOS contributor gates: Messaging config tests fail under the symlinked macOS temporary directoryĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
registrystack/registry-stack#2704 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của registrystack/registry-stack
Issue tương tự
-
help wanted needs investigation priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
[Bug] 建议把黑白主题设置同步到启动页面Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
AstrBotDevs/AstrBot-desktop#197 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
tomast1337/Puppeter-PptxGenJS#440 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
n0-computer/iroh#4709 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
生词本里,已标记为认识的词,按钮写「不认识了」读着别扭Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
qingjian-team/qingjian#1114 ·
Maintainer thường phản hồi trong vòng 2 ngày