Skip to content

refactor!: migrate OpenFeature providers to the thin Confidence client - #461

Draft
andreas-karlsson wants to merge 6 commits into
mainfrom
migrate-to-stateless-client
Draft

andreas-karlsson wants to merge 6 commits into
mainfrom
migrate-to-stateless-client

Conversation

@andreas-karlsson

@andreas-karlsson andreas-karlsson commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Move both OpenFeature providers from the stateful Confidence API to ConfidenceClient and serializable FlagBundle results. Server evaluations resolve and apply the requested flag per call; the web provider resolves per context and records exposure only for evaluated flags.

Add event publishing through OpenFeature tracking with attribution from the effective evaluation context. Harden delivery with request deadlines, UTF-8-aware keepalive sizing, page-hide exposure flushing, one bounded retry for transient exposure failures, and shutdown that drains pending writes. Events are not automatically retried because an ambiguous failure could produce duplicates. Malformed publish responses report failure instead of success.

Compatibility and release

  • Prepare the SDK as 0.4.0; both providers require >=0.4.0 <0.5.0. Widen the existing React package's SDK peer range because the legacy Confidence API remains available.
  • Provider factories accept configuration options instead of existing Confidence instances; provider constructors use ConfidenceClient.
  • The thin client uses clientSecret and region; custom routing goes through the fetch transport. WriteResult replaces ApplyResult.
  • OpenFeature minimum versions are web SDK 1.3.2 and server SDK 1.16.0.
  • The existing Confidence class and React implementation remain; their replacement/removal is separate work.

Validation

  • All CI checks pass on 6a524b4: Build-And-Test, Build-And-Test-CSR, E2E-Test, and commit validation. The legacy SDK E2E assertion now matches the unprefixed flag-name contract.
  • Updated root and package READMEs and added concepts/migrate-to-thin-client.md; checked syntax in 41 TypeScript snippets and relative documentation links.
  • 295 non-E2E tests passed. The 61 provider tests also exit normally without forced shutdown; the broader SDK suite still leaves the process running after completion.
  • 36 live E2E tests passed across the thin client and both providers, including resolve-token/apply round trips. Corrected a stale web fixture, awaited context reconciliation, and accounted for the minimum OpenFeature version dropping error messages.
  • Build, lint, formatting, bundle/API checks, and packed ESM/CommonJS consumer checks passed.
  • Live event publishing and real-browser navigation delivery have not been verified; these paths have mocked coverage.

✔️ Checklist

  • All tests are passing (full CI, including E2E and CSR)
  • Relevant documentation updated
  • linter/style run on changed files
  • Tests added for new functionality
  • Regression tests added for bug fixes
  • Tested in a corresponding example app

andreas-karlsson and others added 5 commits September 11, 2026 13:53
Add ConfidenceClient.publish, sending one event or a batch in a single
request, and implement the OpenFeature tracking API on both providers.

Nothing is queued: the request goes out on call, with keepalive in browsers
so an event fired just before a navigation still arrives. payload.context
carries attribution, and eventTime is per event so a batching layer built on
top can preserve real event timing.

Replace ConfidenceClient's url option with region, which places both the
resolver and the events service — events are a separate service carrying data
of their own, so one url could never put both in the right region. Rewriting
URLs outright stays possible through fetch.

BREAKING CHANGE: The OpenFeature peer floors move to web-sdk >=1.3.2 and
server-sdk >=1.16.0, the earliest releases exposing track against a core that
has the tracking types.

BREAKING CHANGE: ConfidenceClient.Options.flagClientSecret is renamed
clientSecret, and its url option is replaced by region. Pass a fetch that
rewrites the URL to reach a resolver of your own.

BREAKING CHANGE: ConfidenceClient.ApplyResult is renamed WriteResult, which
publish returns too.

BREAKING CHANGE: The resolveBaseUrl option is removed from both provider
factories, superseded by region plus the fetch escape hatch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Codex <noreply@openai.com>

This branch has not been deployed

No deployments
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.

2 participants