Skip to content

fix: Signal readiness when selectorless initializers are exhausted - #499

Merged
kinyoklion merged 1 commit into
mainfrom
devin/1794594960-fdv2-selectorless-init
Nov 20, 2026
Merged

kinyoklion merged 1 commit into
mainfrom
devin/1794594960-fdv2-selectorless-init

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

launchdarkly/ld-relay#979 serves FDv2 full payloads with no selector. When only initializers provided such data, the SDK applied it, but the startup wait signaled readiness only for selector-bearing payloads. Startup then stayed pending until a synchronizer succeeded. The contract test is launchdarkly/sdk-test-harness#600.

Describe the solution you've provided

This implements DATASYSTEM v2 requirements 1.1.3 and 1.1.5:

  • A selector-bearing initializer payload still ends initialization immediately.
  • A selectorless payload is applied, and the remaining initializers still run.
  • When the initializers are exhausted, readiness is raised if the in-memory store was initialized during this run.

store.rb exposes the memory store's initialization separately, so data already in a persistent store doesn't trigger readiness. The readiness change is in fdv2.rb.

Describe alternatives you've considered

Checking the store's general initialized state. With a persistent store, that would report ready before any data arrived in this process.

Additional context

  • bundle exec rspec (1688 examples, 0 failures) and bundle exec rubocop pass.
  • The selectorless group from sdk-test-harness#600 passes 5/5 with the Ruby contract service.

Link to Devin session: https://app.devin.ai/sessions/f3b22e19bdde48f1b39f77808077390b
Open in Devin Desktop: https://app.devin.ai/desktop/session/f3b22e19bdde48f1b39f77808077390b?variant=devin
Requested by: @kinyoklion

SDK-3727


Note

Overview
Fixes startup hanging when FDv2 initializers return selectorless full payloads (e.g. from ld-relay): data was applied but @ready_event stayed unset until a synchronizer succeeded.

After all initializers finish, run_initializers now sets readiness when the in-memory store was populated during that run (memory_initialized?), not when a read-only persistent cache alone is “initialized.” Store exposes that separate check so stale cached data does not unblock startup.

Selector-bearing initializer payloads still end initialization and signal ready immediately; remaining initializers still run for selectorless success. New selectorless initialization specs cover exhaustion-with-synchronizer-pending, data applied before ready, persistent-store-only negative case, and unchanged selector-bearing short-circuit.

Reviewed by Cursor Bugbot for commit b4a51d7. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Risk: low.

Automated risk review (dry run): Low

This PR would be automatically approved.

Why: This is a narrow FDv2 initializer-exhaustion fix in fdv2.rb plus a memory_initialized? accessor on the in-memory store, with unit tests covering selectorless readiness, data application, and persistent-store false-ready. Bugbot completed with no findings.

If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dry-Run PR Approver

@kinyoklion
kinyoklion merged commit 22fda02 into main Nov 20, 2026
18 of 19 checks passed
@kinyoklion
kinyoklion deleted the devin/1794594960-fdv2-selectorless-init branch November 20, 2026 17:01
keelerm84 pushed a commit that referenced this pull request Nov 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[8.20.1](8.20.0...8.20.1)
(2026-11-20)


### Bug Fixes

* Prevent a NaN or infinite metric value from discarding all events in a
flush
([#498](#498))
([2b0f4ef](2b0f4ef))
* Restart the stream when a delete event has a version that is not an
integer
([#501](#501))
([d060827](d060827))
* Signal readiness when selectorless initializers are exhausted
([#499](#499))
([22fda02](22fda02))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants