Skip to content

[Multi-provider] Gaps identified relative to js-sdk reference implementation #211

@jonathannorris

Description

@jonathannorris

Context

We conducted a cross-SDK comparison of all MultiProvider implementations using the js-sdk as the reference. The Kotlin MultiProvider is functional for basic use cases, but we identified several gaps relative to the reference implementation. Hook support is already tracked in #171.

Gaps

1. Tracking event forwarding (High)

The MultiProvider inherits the default no-op track() from FeatureProvider. Tracking events are not forwarded to child providers.

Expected behavior:

  • Iterate over child providers and forward track() calls
  • Skip providers that are not in a ready/active state
  • Errors from individual track() calls should be caught and logged, not propagated

Reference: js-sdk multi-provider.ts track(), dotnet-sdk MultiProvider.cs Track()

2. Strategy should be able to skip NOT_READY/FATAL providers (Medium)

The Strategy.evaluate() method receives a List<FeatureProvider> with no status information. Strategies cannot preemptively skip providers that are NOT_READY or FATAL -- they must attempt evaluation and handle the resulting error reactively. The childProviderStatuses map is private to MultiProvider and not exposed.

Expected behavior:

  • The strategy should receive per-provider status alongside each provider (e.g. via a wrapper type or extended context)
  • The default behavior should skip providers in NOT_READY or FATAL status before attempting evaluation
  • This avoids unnecessary evaluation attempts and cleaner error handling

Reference: js-sdk BaseEvaluationStrategy.shouldEvaluateThisProvider(), dotnet-sdk BaseEvaluationStrategy.ShouldEvaluateThisProvider()

3. ComparisonStrategy (Medium)

Only FirstMatchStrategy and FirstSuccessfulStrategy exist. There is no ComparisonStrategy for evaluating all providers and comparing results (useful for migration validation and consistency checks).

Expected behavior:

  • Evaluate all providers (ideally in parallel)
  • If all providers agree on the value, return it
  • If providers disagree, call an optional onMismatch callback and return the designated fallback provider's result
  • If any provider errors, collect and report all errors
  • Constructor accepts a fallbackProvider and optional onMismatch callback

Reference: js-sdk comparison-strategy.ts, go-sdk comparison_strategy.go, dotnet-sdk ComparisonStrategy.cs

Related Issues

Spec Reference

https://openfeature.dev/specification/appendix-a/#multi-provider

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions