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

default skip on, persist feature flags through session #218

Merged
merged 4 commits into from
Jul 29, 2024

Conversation

mike-dydx
Copy link
Contributor

@mike-dydx mike-dydx commented Jul 29, 2024

Description / Intuition

  • implement a default value for feature flags for new Statsig configs and also first-app launches
  • persist feature flags for the entirety of the session so that their first access sets the session's value

Before/After Screenshots or Videos

the below are print-outs for the isOn function to exhibit how the feature flags behave session-to-session

with printing code:
Screenshot 2024-07-29 at 6 59 30 PM

note force-mainnet is not on Statsig and thus always unavailable

first app launch:
Screenshot 2024-07-29 at 6 49 50 PM

second app launch:
Screenshot 2024-07-29 at 6 52 03 PM

3rd app launch after flag value was toggled to false in statsig (remember this will result in previously cached value_:
Screenshot 2024-07-29 at 6 52 03 PM

4th app launch after flag was toggled back to true in statsig (this will result in (step-1)'s value):
Screenshot 2024-07-29 at 6 55 38 PM

5ht app launch
Screenshot 2024-07-29 at 6 52 03 PM


Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring or Technical Debt
  • Documentation update
  • Other (please describe: )

@mike-dydx mike-dydx requested a review from ruixhuang July 29, 2024 23:04
@@ -12,12 +12,6 @@ import Combine
public class CompositeFeatureFlagsProvider: NSObject & FeatureFlagsProtocol {
public var local: FeatureFlagsProtocol?
public var remote: FeatureFlagsProtocol?

public var newValuesAvailablePublisher: AnyPublisher<Void, Never> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no longer necessary since we are keeping session values constant for entire session after first access

@ruixhuang ruixhuang merged commit 849ed21 into develop Jul 29, 2024
2 checks passed
@ruixhuang ruixhuang deleted the mike/default-skip-on branch July 29, 2024 23:37
mike-dydx added a commit that referenced this pull request Aug 20, 2024
* default to using skip

* Revert "default to using skip"

This reverts commit 2816867.

* implement default value and session feature flag consistency

* Delete contents.xcworkspacedata

---------

Co-authored-by: Mike <[email protected]>
mike-dydx added a commit that referenced this pull request Aug 21, 2024
* default to using skip

* Revert "default to using skip"

This reverts commit 2816867.

* implement default value and session feature flag consistency

* Delete contents.xcworkspacedata

---------

Co-authored-by: Mike <[email protected]>
mike-dydx added a commit that referenced this pull request Aug 21, 2024
* default to using skip

* Revert "default to using skip"

This reverts commit 2816867.

* implement default value and session feature flag consistency

* Delete contents.xcworkspacedata

---------

Co-authored-by: Mike <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants