@@ -14,10 +14,12 @@ import type { EvaluationContext, JsonValue, PrimitiveValue } from '../types';
1414
1515// TODO(FFL-2837): Replace this legacy UFC v1 alias with
1616// `NonNullable<FlagsConfiguration['rules']>['response']` after a flagging-core
17- // release contains DataDog/openfeature-js-client#344 through `41dff20`. Keep the
18- // `FlagsConfiguration` type import on the flagging-core package root. PR #344
19- // preserves protobuf integers as `bigint`, and its evaluator reports unsafe
20- // conversions as deterministic per-flag `PARSE_ERROR` results.
17+ // release contains DataDog/openfeature-js-client#344 through `41dff20`, restores
18+ // 32-byte SHA digest validation, and defines or fixes integer evaluation without
19+ // global `BigInt`. Keep the `FlagsConfiguration` type import on the flagging-core
20+ // package root. PR #344 preserves protobuf integers as `bigint`, and its evaluator
21+ // reports unsafe conversions as deterministic per-flag `PARSE_ERROR` results when
22+ // `BigInt` is available.
2123type RulesConfigurationResponse = UniversalFlagConfigurationV1 ;
2224
2325export type RulesValueType = 'boolean' | 'string' | 'number' | 'object' ;
@@ -128,7 +130,8 @@ const hasOwn = (value: object, key: PropertyKey): boolean =>
128130 Object . prototype . hasOwnProperty . call ( value , key ) ;
129131
130132// TODO(FFL-2837): Delete this compatibility error store after a flagging-core
131- // release contains DataDog/openfeature-js-client#344 through `41dff20`.
133+ // release contains DataDog/openfeature-js-client#344 through `41dff20` and fixes
134+ // or explicitly excludes integer and shard evaluation without global `BigInt`.
132135// The generated protobuf evaluator validates the requested flag and the data
133136// that evaluation reaches. It does not build this error map during parsing.
134137// It returns deterministic `PARSE_ERROR` results, including for an integer that
@@ -462,10 +465,11 @@ export const prepareRulesConfiguration = (
462465 const clone = cloneValue ( value ) ;
463466
464467 // TODO(FFL-2837): Delete this legacy JSON clone and validator after a
465- // flagging-core release contains upstream PR #344 through `41dff20`. That
468+ // flagging-core release contains upstream PR #344 through `41dff20` and the
469+ // no-`BigInt` integer contract is fixed or declared unsupported. That
466470 // implementation preserves protobuf integers as `bigint` and validates only
467- // the requested flag data that evaluation reaches. It returns a deterministic
468- // per-flag error when evaluation cannot produce a safe JavaScript number.
471+ // the requested flag data that evaluation reaches. With `BigInt`, it returns a
472+ // deterministic per-flag error when evaluation cannot produce a safe number.
469473 // Do not adapt this validator to the generated response type.
470474 const errorMessage = validateRulesConfigurationEnvelope ( clone ) ;
471475 if ( errorMessage ) {
@@ -557,7 +561,7 @@ export const flaggingCoreRulesEngine: RulesEngine = {
557561 // TODO(FFL-2837): Delete this compatibility check with the local error
558562 // store after the published PR #344 evaluator through `41dff20` validates
559563 // reached flag data and reports deterministic errors, including unsafe
560- // integer conversions.
564+ // integer conversions with and without global `BigInt` when supported .
561565 const configurationError = errorsByConfiguration
562566 . get ( request . configuration )
563567 ?. get ( request . flagKey ) ;
0 commit comments