Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feature) Implement Open-feature web provider. #662

Closed
thomaspoignant opened this issue Apr 6, 2023 · 2 comments · Fixed by open-feature/js-sdk-contrib#474
Closed

(feature) Implement Open-feature web provider. #662

thomaspoignant opened this issue Apr 6, 2023 · 2 comments · Fixed by open-feature/js-sdk-contrib#474
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed javascript open-feature p1 High priority provider Related to a openfeature provider

Comments

@thomaspoignant
Copy link
Owner

Requirements

Now that the Open Feature web SDK is available it could be great to implement a client provider for GO Feature Flag for the web SDK.

To continue to support community initiatives we will place the provider in the js-sdk-contrib repository.

Please create a new folder called go-feature-flag-web and ping @thomaspoignant for review in the pull request on the contrib repo.

@thomaspoignant thomaspoignant added enhancement New feature or request good first issue Good for newcomers provider Related to a openfeature provider open-feature javascript help wanted Extra attention is needed labels Apr 6, 2023
@thomaspoignant thomaspoignant self-assigned this May 17, 2023
@thomaspoignant
Copy link
Owner Author

thomaspoignant commented May 17, 2023

This diagram represents the life cycle we want to introduce:

sequenceDiagram
    participant sdk as Open Feature SDK
    participant provider as GO Feature Flag provider
    participant proxy as GO Feature Flag relay proxy
    sdk->>provider: intialize
    
    provider->>proxy: Call getAllFlags() API
    proxy-->>provider: all flags
    
    provider->>proxy: Start websocket hand check
    proxy-->>provider: Websocket session open
    provider-->>sdk: end of initialization
    
    Note over sdk,proxy: After this moment we can call the SDK to be able to retrieve flag values

    loop Every X minutes
        provider->>proxy: Call getAllFlags() API
        proxy-->>provider: all flags
    end

    alt flag changes
        proxy-->>provider: (websocket) notify flag change
        provider->>proxy: Call getAllFlags() API
        proxy-->>provider: all flags
    end
    
    sdk->>provider: getBool()
    provider->>provider: reading flag value in cache
    provider-->>sdk: usage cache value to return result
Loading

In case of disconnection of the WebSocket, we should be able to reconnect using a random exponential backoff algorithm to avoid a pick in a number of connections at one.

@thomaspoignant
Copy link
Owner Author

thomaspoignant commented Jul 20, 2023

A first version of the provider is in review in the open-feature contrib repository: open-feature/js-sdk-contrib#474.

It requires a fix in the web-sdk to work perfectly, I have open this issue open-feature/js-sdk#488.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed javascript open-feature p1 High priority provider Related to a openfeature provider
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant