Skip to content

fix!: Use None rather than zero for indefinite initialization waiting - #64

Draft
kinyoklion wants to merge 1 commit into
mainfrom
devin/1789569799-python-indefinite-start-wait
Draft

kinyoklion wants to merge 1 commit into
mainfrom
devin/1789569799-python-indefinite-start-wait

Conversation

@kinyoklion

Copy link
Copy Markdown
Member

Aligns start_wait with the OpenFeature provider spec (OFP), which requires a distinct non-duration value to request indefinite initialization waiting.

  • start_wait=None now requests an indefinite wait: the constructor does not block and initialize waits until the data source becomes valid or fails permanently.
  • start_wait=0 no longer waits indefinitely; it waits nowhere, so initialize reports a failed initialization unless the client is already ready, and readiness is observed through provider events.
  • Positive values are unchanged: the constructor bounds the wait and initialize returns immediately with whatever the outcome is.
  • Breaking for anyone relying on 0 meaning "wait forever".

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

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".

None is now passed to LDClient as a zero construction wait, with the waiting performed in initialize against the data source status listener.

Testing: make test (88 tests) and make lint (mypy) pass. New tests cover the zero and indefinite cases, including that the constructor does not block when None is 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

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

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown
Contributor

@cursor review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devin-pr Pull request created by Devin AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant