Skip to content

feat(openfeature): expose dynamic offline rules (FFL-2837 PR3) - #1348

Closed
btthomas wants to merge 17 commits into
blake.thomas/FFL-2837-PR2from
blake.thomas/FFL-2837-PR3
Closed

btthomas wants to merge 17 commits into
blake.thomas/FFL-2837-PR2from
blake.thomas/FFL-2837-PR3

Conversation

@btthomas

@btthomas btthomas commented Jul 24, 2026 •

Copy link
Copy Markdown
Collaborator

Pull request stack

  1. Plan PR (#1345)
  2. PR1: Rules engine boundary (#1346)
  3. PR2: Dynamic offline evaluation (#1347)
  4. PR3: Provider API and documentation (feat(openfeature): expose dynamic offline rules (FFL-2837 PR3) #1348) <- you are here

This description uses Simplified Technical English. Technical names and API names do not change.

Summary

This PR exposes dynamic offline rules through the existing offline provider.

  • The provider passes every effective OpenFeature context to FlagsClient.
  • The provider treats {} as a real context.
  • clearContext() does not restore a context from the configuration.
  • A missing targeting key stays missing.
  • Rules configurations stay ready after context changes.
  • Context changes do not fetch configurations.
  • Configuration parse failures produce provider errors.
  • Recovery emits Ready before ConfigurationChanged.
  • The README explains precomputed, rules, and mixed configurations.
  • Both example applications include a rules-context switch.

Protobuf integration

  • Integration tests and examples use a version 1 rules.response envelope.
  • The response contains one base64 encoding of UFC protobuf bytes.
  • The integration test changes the context and evaluates locally.
  • The integration test verifies targeting-key sharding and no configuration fetch.
  • The integration test verifies an unsafe int64 PARSE_ERROR and no tracking for that error.
  • No legacy rulesBased JSON fixture remains.

OpenFeature behavior

OpenFeature supplies {} for an unset or cleared global context. The provider cannot distinguish this state from an explicit {}. Therefore, it passes {} literally. For a context-specific precomputed configuration, the application explicitly sets the context returned by getPrecomputedContext(configuration).

Matching precomputed data has priority when both capabilities exist. Rules data is the fallback for a different context.

TODO status

This PR adds no new TODO(FFL-2837) marker. The complete stacked branch has the two PR1 follow-ups for regular-expression limits and the future peer-dependency minimum.

Checks

  • Core and OpenFeature TypeScript checks
  • Changed-file ESLint and formatting checks
  • 160 focused flags and OpenFeature tests
  • git diff --check

This PR remains a draft.

@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR2 branch from cb5597d to 932c87b Compare July 27, 2026 20:13
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR3 branch from dbf9a5f to ec8e68a Compare July 27, 2026 20:28
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR2 branch from 932c87b to a725eb5 Compare July 28, 2026 19:47
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR3 branch 2 times, most recently from d6670ab to b4dc7a4 Compare July 29, 2026 14:27
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR2 branch 2 times, most recently from 45a8242 to 0cc9e56 Compare July 30, 2026 13:37
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR3 branch from b4dc7a4 to f668b3f Compare July 30, 2026 13:37
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR2 branch from 0cc9e56 to 31018a5 Compare July 31, 2026 13:58
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR3 branch from f668b3f to b612833 Compare July 31, 2026 13:58
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR2 branch from 31018a5 to c804067 Compare August 3, 2026 15:45
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR3 branch from b612833 to 87ae73c Compare August 3, 2026 15:45
Comment on lines +75 to +77
isEmptyContext(_context)
? undefined
: toDdContextPreservingTargetingKey(_context),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This converts an empty effective OpenFeature context ({}) to undefined, causing FlagsClient to reuse its stored/embedded context, and this is being removed in #1359, right?

@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR2 branch from c804067 to 0014b99 Compare August 7, 2026 01:00
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR3 branch from 87ae73c to 6e3fcfe Compare August 7, 2026 01:00
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR2 branch from 0014b99 to 8a11853 Compare August 7, 2026 12:24
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR3 branch from 6e3fcfe to 2bdc125 Compare August 7, 2026 12:24
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR2 branch from 8a11853 to d4d92d0 Compare August 10, 2026 18:54
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR3 branch from 2bdc125 to c261929 Compare August 10, 2026 18:54
@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0209c29 | Docs | View more details | Give us feedback!

@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR2 branch from d4d92d0 to 7b38d92 Compare August 11, 2026 20:09
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR3 branch from c261929 to c7fee24 Compare August 11, 2026 20:09
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR2 branch from 7b38d92 to 7e4aca2 Compare August 18, 2026 12:39
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR3 branch from c7fee24 to 423ae55 Compare August 18, 2026 12:39
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR2 branch from 7e4aca2 to a678a7e Compare August 20, 2026 16:37
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR3 branch from 423ae55 to ac5785f Compare August 20, 2026 16:37
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR2 branch from a678a7e to 1f6c1d3 Compare September 15, 2026 13:56
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR3 branch 2 times, most recently from 7670c4a to 391e617 Compare September 15, 2026 15:26
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR2 branch from 7ea2311 to 0a88b52 Compare September 18, 2026 13:50
@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR3 branch from 391e617 to 0209c29 Compare September 18, 2026 13:50
@greghuels

Copy link
Copy Markdown
Contributor

Closing since we took a different implementation path

@greghuels greghuels closed this Oct 2, 2026
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.

3 participants