Environment builders panic on a document they cannot deserialise
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 65/100
Línea de trabajo
El issue apunta a src/environments/builders.rs y las funciones build_environment_struct y build_environment_api_key_struct. Comience examinando estas funciones y su uso actual de serde_json::from_value(value).unwrap(). Comprenda las estructuras Environment y EnvironmentAPIKey y su deserialización con Serde. La tarea es cambiar los tipos de retorno a Result<Environment, serde_json::Error> y Result<EnvironmentAPIKey, serde_json::Error>, luego actualizar cualquier llamador. Verifique otros usos en la base de código y el issue del cliente vinculado para garantizar compatibilidad. Ejecutar las pruebas existentes verificará que el cambio no rompa la funcionalidad.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
build_environment_struct and build_environment_api_key_struct in src/environments/builders.rs are serde_json::from_value(value).unwrap(). A document the engine cannot deserialise panics the caller instead of returning an error. The input is whatever the network delivered, so a misbehaving server, or anyone on the path of a plain-HTTP self-hosted deployment, can crash every process embedding the engine, and callers have no way to catch it short of catch_unwind.
In flagsmith-rust-client 3.1.1 that panic happened on the SDK's background refresh thread while it held the datastore mutex, which poisoned the lock and made every later flag read panic as well. Flagsmith/flagsmith-rust-client#62 fixes that on the client side by deserialising the document itself with an error return, so the client no longer calls these builders. Any other caller still gets the panic.
Proposed: return Result<Environment, serde_json::Error> and Result<EnvironmentAPIKey, serde_json::Error> from the two builders. That is a breaking change to the public API, so it wants a version bump and updates to the callers, the Rust client included. Happy to send a PR if this works.
- Lenguaje dominante
- Rust
- Estrellas
- 1
- Forks
- 0
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 Flagsmith/flagsmith-rust-flag-engine
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
-
Dependency DashboardAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Todos los issues de Flagsmith/flagsmith-rust-flag-engine
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
swc-project/swc#12576 ·
Los mantenedores suelen responder en 1 día
-
good first issue gpu serve
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
biomejs/biome#12475 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día