BReg refuses valid crs84-point coordinates near zero at precision 6 or more
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- backend-api-design
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 2
- Fork
- 0
- Merge medio
- 9h 48m
- PR unite (30g)
- 151
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di registrystack/registry-stack
-
area:breg enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
registrystack/registry-stack#2765 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
registrystack/registry-stack#2761 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
registrystack/registry-stack#2743 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
registrystack/registry-stack#2706 ·
I maintainer di solito rispondono entro 1 giorno
-
macOS contributor gates: Messaging config tests fail under the symlinked macOS temporary directoryAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
registrystack/registry-stack#2704 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di registrystack/registry-stack
Issue simili
-
help wanted needs investigation priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
[Bug] 建议把黑白主题设置同步到启动页面Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
AstrBotDevs/AstrBot-desktop#197 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
tomast1337/Puppeter-PptxGenJS#440 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
n0-computer/iroh#4709 ·
I maintainer di solito rispondono entro 1 giorno
-
生词本里,已标记为认识的词,按钮写「不认识了」读着别扭Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
qingjian-team/qingjian#1114 ·
I maintainer di solito rispondono entro 2 giorni