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

[PAY-1578] Hide USDC-gated tracks if the feature flag is disabled #3752

Merged
merged 2 commits into from
Jul 17, 2023

Conversation

schottra
Copy link
Contributor

Description

Using a similar strategy to #2956 , inserts a step into the lineup processing that treats USDC-gated tracks as "deleted" in all cases. This should take care of all environments since it's done at the generic lineup saga level.

Dragons

You could still navigate directly to a USDC-gated track. But I think our goal for now is to not surface these tracks into feeds/trending/artist pages.

How Has This Been Tested?

Tested locally on web/mobile web/ simulator

How will this change be monitored?

N/A

Feature Flags

Uses the USDC_PURCHASES feature flag. On by default in development.

@@ -46,6 +49,10 @@ function* filterDeletes(tracksMetadata, removeDeleted) {
const remoteConfig = yield getContext('remoteConfigInstance')
yield call(remoteConfig.waitForRemoteConfig)

const isUSDCGatedContentEnabled = yield getFeatureEnabled(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: In the PR I based this on, there was a waitForRead() at this point. Looking into what waitForRead is waiting on (reachability and account), I don't think there's any additional need to wait on that condition here if the original lineup processing wasn't already waiting for it.
But if others can think of a reason why we should, I'm happy to add it.

Copy link
Contributor

@dharit-tan dharit-tan left a comment

Choose a reason for hiding this comment

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

awesome!
seeing type errors and noticed that latest commit is a merge from main, probably bad merge there.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Jul 17, 2023
@@ -106,8 +107,11 @@ export const CollectibleGatedFields = ({
// which makes the dropdown show the placeholder.
// Otherwise, the default value is the nft collection which was previously selected,
// which also includes the collection image.
const defaultCollectionName =
premiumConditionsValue?.nft_collection?.name ?? ''
const defaultCollectionName = isPremiumContentCollectibleGated(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dharit-tan You were correct on the bad merge. There are some new reads of the gating conditions on main that needed to be updated to use the union type.
Starting to wonder if this is actually useful as it requires calling multiple type checker functions each time we're trying to switch on the gate type? 😬

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah sigh.. it's still gives more type safety tho right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does! And it's useful in the cases where you're checking for one specific condition before moving forward. I think it's clunky for the handful of cases where we are handling all of the types of premium content in one place.

@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/pay-1578-hide-usdc-tracks

@schottra schottra merged commit b4854a1 into gated-content-updates Jul 17, 2023
@schottra schottra deleted the pay-1578-hide-usdc-tracks branch July 17, 2023 15:26
@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.

6 participants