Environment builders panic on a document they cannot deserialise
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 65/100
Direzione di ricerca
L'issue punta a src/environments/builders.rs e le funzioni build_environment_struct e build_environment_api_key_struct. Inizia esaminando queste funzioni e il loro attuale utilizzo di serde_json::from_value(value).unwrap(). Comprendi le strutture Environment e EnvironmentAPIKey e la loro deserializzazione Serde. Il compito è cambiare i tipi di ritorno in Result<Environment, serde_json::Error> e Result<EnvironmentAPIKey, serde_json::Error>, quindi aggiornare tutti i chiamanti. Controlla altri utilizzi nella codebase e l'issue del client collegato per garantire la compatibilità. Eseguire i test esistenti verificherà che la modifica non comprometta la funzionalità.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 1
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 Flagsmith/flagsmith-rust-flag-engine
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
-
Dependency Dashboard Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Tutte le issue di Flagsmith/flagsmith-rust-flag-engine
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
nautechsystems/nautilus_trader#5095 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
stellar/rs-soroban-env#1739 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug good first issue package: quic
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100