-
Notifications
You must be signed in to change notification settings - Fork 10
feat: only warn about missing feature context when feature is used #459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: only warn about missing feature context when feature is used #459
Conversation
…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.
There was a problem hiding this 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
noUncheckedIndexedAccessoption - 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.
pavkam
left a comment
There was a problem hiding this 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.
noUncheckedIndexedAccessoption totsconfig.jsonfor stricter type checking.getFeatureDefinitionsmethod to now return synchronousFeatureDefinition[]._getFeaturesRemotemethod (now returns a disabled feature rather than undefined when feature is missing).