Skip to content

Control#278

Draft
dferber90 wants to merge 12 commits intomainfrom
control
Draft

Control#278
dferber90 wants to merge 12 commits intomainfrom
control

Conversation

@dferber90
Copy link
Collaborator

@dferber90 dferber90 commented Feb 17, 2026

Refactors the internals of vercel-flags-core:

  • adds a controller which does no I/O itself and only controls the various data sources
    • renames the original dataSource to controller
  • adds blackbox tests (currently two variants, one with a mocked fetch, one with msw)
    • i added both so we can decide which one is easier to work with before adding more tests
    • goal would be that all tests are black box tests so we can refactor internals without rewriting tests going forward

As part of this PR we should tighten the fallback behavior

  • if steam is not reachable, do we fall back to polling or fall back to embedding?
  • ensure polling stops if stream re-connects
  • always retry stream in 60s+jitter intervals if we fell back
  • transport information about data source
    • store whether current in-memory data came from streaming, polling, fallback
    • store whether data is considered stale
      • if stream is disconnected it's considered stale?
      • would polling always count as stale even if stream was disabled?
  • should the init timeout be configured on the client (current state) or on the .initialize({ timeout: number }) call?

Transactions concept where we guarantee the same definitions are used while handling as single request to avoid situations like this where flagA and flagB are handled as part of the same request but potentially use different underlying configuration:

await flagA()
// stream receives updated configuration
await flagB()

@vercel
Copy link
Contributor

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flags-sdk-dev Ready Ready Preview, Comment, Open in v0 Feb 17, 2026 7:31am
shirt-shop Ready Ready Preview, Comment, Open in v0 Feb 17, 2026 7:31am
shirt-shop-api Ready Ready Preview, Comment, Open in v0 Feb 17, 2026 7:31am

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​vercel/​edge@​1.2.21001007288100
Added@​fetch-mock/​vitest@​0.2.181001007986100
Addedfetch-mock@​12.6.01001008184100
Updatedreact@​19.3.0-canary-6066c782-20260212 ⏵ 19.3.0-canary-03ca38e6-202602131001008498100
Addedflags@​4.0.11001009490100

View full report

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.

1 participant