Skip to content
This repository was archived by the owner on Oct 4, 2023. It is now read-only.

[C-841] Put getFeatureEnabled in storeContext#1727

Merged
sliptype merged 8 commits into
mainfrom
sk-c-841-getfeatureenabled-storecontext
Aug 17, 2022
Merged

[C-841] Put getFeatureEnabled in storeContext#1727
sliptype merged 8 commits into
mainfrom
sk-c-841-getfeatureenabled-storecontext

Conversation

@sliptype

Copy link
Copy Markdown
Contributor

Description

Moves getFeatureEnabled to storeContext in preparation for notification sagas

Dragons

Is there anything the reviewer should be on the lookout for? Are there any dangerous changes?

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide repro instructions & any configuration.

How will this change be monitored?

For features that are critical or could fail silently please describe the monitoring/alerting being added.

Feature Flags

Are all new features properly feature flagged? Describe added feature flags.

@dylanjeffers dylanjeffers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks great, isn't there also the getFeatureEnabled in the audius-backend-instance? we using the same one there and here? Also just wanted to double check regarding the NATIVE_MOBILE removals!

export const storeContext: CommonStoreContext = {
getLocalStorageItem: async (key) => AsyncStorage.getItem(key),
setLocalStorageItem: async (key, value) => AsyncStorage.setItem(key, value),
getFeatureEnabled,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

so can we use remoteConfigInstance to call getFeatureEnabled, or are they separate things?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They are separate things right now. The getFeatureFlag helper checks local storage for the feature flag overrides, but I think I can consolidate it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually we do need both, the one in remoteConfig is used by the feature flag modal to show the default state. The helper is used by actual features to check if they're enabled accounting for overrides. I could return the one from audiusBackendInstance out and update the usages to use that one, but it seems like it makes more sense at the top level of the storeContext. wdyt?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah im good with top level, but was just wondering why it seemed like we had duplicate things. maybe when everything is sorted, we take a loot at context and see if we can consolidate? things like getLocalStorageItem vs localStorage, is another example

const audiusBackendInstance = yield* getContext('audiusBackendInstance')
yield* call(waitForBackendSetup)
yield* call(audiusBackendInstance.markAllNotificationAsViewed)
if (NATIVE_MOBILE) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cool this is going away now! is it safe to do in this intermediate phase?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No this shouldn't have been part of this commit, my b

@pull-request-size pull-request-size Bot added size/M and removed size/S labels Aug 16, 2022
@sliptype sliptype requested a review from dylanjeffers August 16, 2022 22:22
@audius-infra

Copy link
Copy Markdown
Collaborator

@sliptype sliptype merged commit 97a1087 into main Aug 17, 2022
@sliptype sliptype deleted the sk-c-841-getfeatureenabled-storecontext branch August 17, 2022 15:28
@sliptype sliptype mentioned this pull request Aug 18, 2022
@AudiusProject AudiusProject deleted a comment from linear Bot Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants