[flagd] The two resolvers disagree on numeric coercion: in-process returns TYPE_MISMATCH, RPC returns 0
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Confronta i percorsi del resolver in-process e RPC del provider usando il caso get_integer_details descritto nell’issue, iniziando dai risultati esistenti della conformance-suite e dalla voce relativa alla deviazione nota. Verifica il flagd coercion ADR e il comportamento del resolver rispetto a flagd-testbed:v3.8.0. Il lavoro è completato quando il contratto previsto è stato deciso e i risultati dei due trasporti sono allineati, oppure quando la deviazione rimanente è documentata esplicitamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The two resolvers of this provider answer the same question differently, and I would like to know which one is intended before assuming either is wrong.
What I measured
float-flag resolves to 0.5. Requesting it through get_integer_details with a code default of 1:
| resolver | result |
|---|---|
| in-process | 1 — the code default, with TYPE_MISMATCH |
| RPC | 0 — no error code at all |
Both against flagd-testbed:v3.8.0, same flag, same call, same run. The widening direction agrees:
integer-flag (10) requested as a float returns 10.0 from both.
So in-process rejects a lossy narrowing and RPC performs it silently.
Why I am asking rather than filing it as a bug
The rule this would be measured against is flagd's own, not OpenFeature's. OpenFeature has a
single numeric type — number is "a numeric value of unspecified type or size" — and no numbered
requirement says what a provider must do when a value does not fit the accessor it was asked
through; that is an open question of the provider contract
(open-feature/spec#430). flagd accepted a coercion
ADR for itself — coerce when lossless, TYPE_MISMATCH when information would be lost — tracked in
open-feature/flagd#1996.
Against that rule the in-process resolver is already correct and the RPC one is not. But that is
flagd's rule to interpret, which is why this is a question.
What does not depend on which answer is right: two transports of one provider disagreeing is a
vendor-neutrality problem on its own terms. An application that switches resolver= — a
configuration change, not a code change — gets a different value and a different error code for the
same flag and the same call. That is the property the conformance suite exists to check, occurring
inside a single provider.
Calibration from the other languages
Worth knowing before deciding, because it suggests where the fix belongs:
- The Java and Go flagd providers narrow
0.5to0with no error code in both resolvers
— consistent with each other, both matching this repository's RPC behaviour. - This provider is the only one of the four whose two resolvers differ, and the only one where any
resolver implements the ADR's lossy half.
So the in-process path here appears to be ahead of the other implementations rather than behind them.
Questions
- Is the in-process behaviour the intended one, with RPC yet to catch up?
- If so, is the gap in this provider's RPC path, or is it that the evaluation happens server-side
there and the answer has to come from flagd itself? - Is there a reason the two paths should be permitted to differ that I am missing?
Context
Found while building the cross-language provider conformance suite proposed in
open-feature/spec#417. Both resolvers now declare
the @numeric-coercion capability and the results record the difference, with a known-deviation
entry against the RPC suite only — the in-process suite does not carry one, because it does not have
the defect. Nothing is blocked either way.
- Lingua principale
- Python
- Stelle
- 27
- Fork
- 33
- Merge medio
- 5h
- PR unite (30g)
- 10
Guida per i contributori
Apri la guida per i contributori
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 open-feature/python-sdk-contrib
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
UnleashProvider.track has the wrong signature: client.track raises TypeError instead of no-op Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
open-feature/python-sdk-contrib#417 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Tutte le issue di open-feature/python-sdk-contrib
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·