Repository navigation
fix!: Use None rather than zero for indefinite initialization waiting - #64
kinyoklion wants to merge 4 commits into
Conversation
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
@cursor review |
|
Devin check this against the latest version of the spec. |
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6385f3e. Configure here.
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
Rechecked against the latest OFP spec (
|
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com> # Conflicts: # ld_openfeature/provider.py # tests/test_provider.py

Aligns
start_waitwith the OpenFeature provider spec (OFP), which requires a distinct non-duration value to request indefinite initialization waiting.start_wait=Nonenow requests an indefinite wait: the constructor does not block andinitializewaits until the data source becomes valid or fails permanently.start_wait=0no longer waits indefinitely; it waits nowhere, soinitializereports a failed initialization unless the client is already ready, and readiness is observed through provider events.initializereturns immediately with whatever the outcome is.0meaning "wait forever".Requirements
Related issues
None.
Implementation details
OFP requires that a positive start wait bound total construction plus initialization, that zero wait nowhere, and that indefinite waiting avoid construction-time blocking and instead wait during
initialize. Previously zero was overloaded to mean indefinite, leaving no way to express "no waiting at all".Noneis now passed toLDClientas a zero construction wait, with the waiting performed ininitializeagainst the data source status listener.Testing:
make test(88 tests) andmake lint(mypy) pass. New tests cover the zero and indefinite cases, including that the constructor does not block whenNoneis given.Link to Devin session: https://app.devin.ai/sessions/1fd3fcbfe79f482e8b58be29e8df2ffb
Open in Devin Desktop: https://app.devin.ai/desktop/session/1fd3fcbfe79f482e8b58be29e8df2ffb?variant=devin
Requested by: @kinyoklion
Note
Overview
Breaking:
LaunchDarklyProvider’sstart_waitnow matches the OpenFeature provider contract instead of overloading0as “wait forever.”start_wait=0no longer blocks ininitializeuntil the data source is ready. The constructor andinitializereturn quickly; initialization fails withProviderNotReadyErrorunless the LD client is already ready, and apps should watchPROVIDER_READY(and related) events for late readiness.start_wait=Noneis the new indefinite mode: construction passes0toLDClient(non-blocking), andinitializewaits without a timeout until the data source is valid or permanently fails. Positivestart_waitbehavior is unchanged (constructor-bound wait, then immediateinitializeoutcome).Provider lifecycle changes register data-source and flag listeners before the wait, track
ProviderStatuswith an initialization gate so the OpenFeature client owns the first ready/error signal, and still emit later transitions (e.g. ready after a failed init withstart_wait=0). README and tests cover the new semantics, includingDelayedReadyDataSourceand recovery-after-failure event behavior.Reviewed by Cursor Bugbot for commit 949ff46. Bugbot is set up for automated code reviews on this repo. Configure here.