Skip to content

Conversation

@nicklasl
Copy link
Member

@nicklasl nicklasl commented Jan 11, 2025

Aligning with Spec 0.8.0

This PR

Moves all status handling to the SDK and relies on how the Provider respond to different API calls to expose the correct status.

There are multiple breaking changes in this PR since there are multiple places where the Provider APIs are changed to be suspending functions and the provider is also expected to throw exceptions in the case of failures.

There are big wins for the Provider authors here since there is no need for the provider to emit the statuses using the EventHandler, thus this class is removed.

Aligns with open-feature/swift-sdk#46

Notes on Breaking changes

Provider author breakage

  • FeatureProvider initialize and onContextSet are now suspending and are expecting to throw exceptions on errors.
  • EventHandler class is removed.
  • Removed observe() in favour of event handling via SDK calls.

SDK consumer breakage

  • Removed FeatureProvider.awaitReadyOrError() extension function

Copy link
Contributor

@fabriziodemaria fabriziodemaria left a comment

Choose a reason for hiding this comment

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

Looks good! Let's just make sure to align on the main APIs together with the Swift counterpart before shipping

@nicklasl nicklasl force-pushed the rework-states branch 2 times, most recently from e80c6dc to 75b793e Compare January 30, 2025 09:56
@nicklasl
Copy link
Member Author

nicklasl commented Jan 30, 2025

Notes:

@nicklasl nicklasl force-pushed the rework-states branch 2 times, most recently from d1bd76d to 4eb640b Compare January 31, 2025 09:04
nicklasl and others added 3 commits January 31, 2025 13:35
Signed-off-by: Nicklas Lundin <[email protected]>

Signed-off-by: Nicklas Lundin <[email protected]>

fix: mark as throws

Signed-off-by: Nicklas Lundin <[email protected]>

Signed-off-by: Nicklas Lundin <[email protected]>

Signed-off-by: Nicklas Lundin <[email protected]>

Signed-off-by: Nicklas Lundin <[email protected]>

fix: add extra buffer capacity for the status flow

Signed-off-by: Nicklas Lundin <[email protected]>

fix: short circuit on fatal/non ready status

refactor!: align setProvider API naming with Swift SDK

Signed-off-by: Nicklas Lundin <[email protected]>
Signed-off-by: Nicklas Lundin <[email protected]>
@nicklasl nicklasl marked this pull request as ready for review January 31, 2025 12:52
@nicklasl
Copy link
Member Author

Unfortunately at the current state, the Eventing aspect was removed from the SDK.
I'm looking at adding it back but wanted to open up the PR for feedback first.

Copy link
Contributor

@nickybondarenko nickybondarenko left a comment

Choose a reason for hiding this comment

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

Really appreciate the documentation! Great work!

Copy link
Contributor

@fabriziodemaria fabriziodemaria left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Copy link
Member

@beeme1mr beeme1mr left a comment

Choose a reason for hiding this comment

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

Will events be re-added before releasing the update?

@nicklasl
Copy link
Member Author

nicklasl commented Feb 7, 2025

Will events be re-added before releasing the update?

Yeah, that's my plan.
I have some code locally that looks ok but I'm struggling with providing a reliable experience in tests. Always about the threading 😖

@nicklasl nicklasl merged commit 458b564 into open-feature:main Feb 7, 2025
6 checks passed
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.

4 participants