Skip to content

Conversation

@Swiftwork
Copy link
Contributor

@Swiftwork Swiftwork commented Aug 14, 2025

  • Only emit evaluation events for a single feature instead of all if a feature key is provided.
  • Only warn about missing feature context when the feature is used (isEnabled or config).
  • Added noUncheckedIndexedAccess option to tsconfig.json for stricter type checking.
  • Modified getFeatureDefinitions method to now return synchronousFeatureDefinition[].
  • Enhanced error handling in _getFeaturesRemote method (now returns a disabled feature rather than undefined when feature is missing).
  • Updated tests to reflect changes in feature handling and context warnings.

…used

- Added `noUncheckedIndexedAccess` option to `tsconfig.json` for stricter type checking.
- Modified `getFeatureDefinitions` method to now return synchronous`FeatureDefinition[]`.
- Enhanced error handling in `_getFeaturesRemote` method (no longer returns undefined, bug).
- Updated tests to reflect changes in feature handling and context warnings.
@Swiftwork Swiftwork self-assigned this Aug 14, 2025
@Swiftwork Swiftwork added bug Something isn't working enhancement New feature or request labels Aug 14, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors feature flag evaluation to only warn about missing context fields when a feature is actually used, rather than during bulk feature retrieval. The changes include adding stricter TypeScript checking, updating API method signatures, and enhancing error handling.

  • Modified feature definition retrieval to be synchronous and changed warning behavior to trigger on feature access
  • Added stricter TypeScript type checking with noUncheckedIndexedAccess option
  • Enhanced error handling in remote feature fetching methods

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/openfeature-node-provider/src/index.ts Updated to use synchronous getFeatureDefinitions() method
packages/openfeature-node-provider/package.json Version bump and dependency update to node-sdk 1.10.0
packages/node-sdk/tsconfig.json Added noUncheckedIndexedAccess for stricter type checking
packages/node-sdk/test/client.test.ts Updated tests to reflect new warning behavior and removed obsolete test cases
packages/node-sdk/src/types.ts Changed API response types to be more specific and use Record instead of array
packages/node-sdk/src/rate-limiter.ts Added null check for rate limiter timestamp handling
packages/node-sdk/src/client.ts Major refactor of feature evaluation logic and warning system
packages/node-sdk/package.json Version bump to 1.10.0

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@pavkam pavkam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments, but approving as it looks good in general.

@Swiftwork Swiftwork added this pull request to the merge queue Aug 15, 2025
Merged via the queue into main with commit c84de68 Aug 15, 2025
6 checks passed
@Swiftwork Swiftwork deleted the buc-3869-nodesdk-logs-context-warning-for-another-feature-when branch August 15, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants