Skip to content

Conversation

@Datron
Copy link
Collaborator

@Datron Datron commented Jan 28, 2026

Problem

The resolution reason states are missing in the JS provider

Solution

Use resolution reason states in the reason field

Summary by CodeRabbit

  • Refactor
    • Standardized resolution reason values in the feature flag provider across all resolution paths.

✏️ Tip: You can customize this high-level summary in your review settings.

@Datron Datron requested a review from a team as a code owner January 28, 2026 13:01
@semanticdiff-com
Copy link

semanticdiff-com bot commented Jan 28, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  clients/javascript/open-feature-provider/superposition-provider.ts  52% smaller

@coderabbitai
Copy link

coderabbitai bot commented Jan 28, 2026

Walkthrough

Resolution reasons in the Superposition provider were refactored from string literals to the StandardResolutionReasons enum. The logic routes different conditions—stale status, default value matches, and targeting matches—to corresponding enum values. No functional behavior changed.

Changes

Cohort / File(s) Summary
Resolution Reason Enum Refactoring
clients/javascript/open-feature-provider/superposition-provider.ts
Replaced string-based resolution reasons with StandardResolutionReasons enum values. Not-ready/stale/error paths now use StandardResolutionReasons.DEFAULT or .ERROR; normal resolution paths use .STALE, .DEFAULT, or .TARGETING_MATCH based on status and value comparison.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A hop, a skip, through reasons so fine,
From strings into enums, a structured design!
Resolution clarity, standardized true,
No breaking of function, just making it new.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: replacing string-based resolution reasons with StandardResolutionReasons enum in the JS provider.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ayushjain17 ayushjain17 added this pull request to the merge queue Jan 28, 2026
Merged via the queue into main with commit 0609dad Jan 28, 2026
19 checks passed
@ayushjain17 ayushjain17 deleted the js-provider-fix-reason branch January 28, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants