BReg refuses valid crs84-point coordinates near zero at precision 6 or more
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- backend-api-design
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 2
- Forks
- 0
- Merge medio
- 9 h 48 min
- PR fusionados (30 d)
- 151
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de registrystack/registry-stack
-
area:breg enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
registrystack/registry-stack#2765 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
registrystack/registry-stack#2761 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
registrystack/registry-stack#2743 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
registrystack/registry-stack#2706 ·
Los mantenedores suelen responder en 1 día
-
macOS contributor gates: Messaging config tests fail under the symlinked macOS temporary directoryAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
registrystack/registry-stack#2704 ·
Los mantenedores suelen responder en 1 día
Todos los issues de registrystack/registry-stack
Issues similares
-
help wanted needs investigation priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
[Bug] 建议把黑白主题设置同步到启动页面Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
AstrBotDevs/AstrBot-desktop#197 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
tomast1337/Puppeter-PptxGenJS#440 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
n0-computer/iroh#4709 ·
Los mantenedores suelen responder en 1 día
-
生词本里,已标记为认识的词,按钮写「不认识了」读着别扭Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
qingjian-team/qingjian#1114 ·
Los mantenedores suelen responder en 2 días