Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Feature values always have type string when using local evaluation mode

Abierto
#146 0 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
nodejs, typescript
Área
backend

Línea de trabajo

Comienza con la ruta del cliente de Flagsmith que recorren getEnvironmentFlags() y getFlag() cuando enableLocalEvaluation es true, utilizando el script de TypeScript proporcionado para reproducir los distintos tipos de valores. Compara el resultado de la evaluación local con el resultado de la API y verifica que los valores numéricos de las features conserven su tipo numérico en ambos modos.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

We've started seeing an issue where number values like this one are being returned as type string when enableLocalEvaluation is set to true.
Screenshot 2024-03-01 at 11 38 49

Using this test script I've validated that the local evaluation causes the change in behaviour (thanks Matt for the help 🙌 )

This has been tested on flagsmith-nodejs versions 2.5.1 and 3.2.0

import Flagsmith from 'flagsmith-nodejs';

async function main(): Promise<void> {
    const flagClient = new Flagsmith({
        environmentKey: 'ser.key',
        enableLocalEvaluation: true,
        enableAnalytics: false,
    });

    const environmentFlags = await flagClient.getEnvironmentFlags();
    const flag = environmentFlags.getFlag('daisy.settlements.timeout');
    console.log(`flagClient.apiUrl=${flagClient.apiUrl}`);
    console.log(`flagClient.enableLocalEvaluation=${flagClient.enableLocalEvaluation}`);
    console.log(JSON.stringify(flag));
    console.log(`typeof flag.value=${typeof flag.value}`);

    await flagClient.close();
}

void main();

enableLocalEvaluation=true

flagClient.apiUrl=https://edge.api.flagsmith.com/api/v1/
flagClient.enableLocalEvaluation=true
{"value":"60000","enabled":true,"isDefault":false,"featureId":62178,"featureName":"daisy.settlements.timeout"}
typeof flag.value=string

enableLocalEvaluation=false

flagClient.apiUrl=https://edge.api.flagsmith.com/api/v1/
flagClient.enableLocalEvaluation=false
{"value":60000,"enabled":true,"isDefault":false,"featureId":62178,"featureName":"daisy.settlements.timeout"}
typeof flag.value=number
Lenguaje dominante
TypeScript
Estrellas
30
Forks
27
Merge medio
20 h 52 min
PR fusionados (30 d)
6

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Flagsmith/flagsmith-nodejs-client

Todos los issues de Flagsmith/flagsmith-nodejs-client

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.