Skip to content

[C-5416] Basic guest checkout behind feature flag#10447

Merged
isaacsolo merged 7 commits intomainfrom
is-guest-checkout-feature-flag
Nov 18, 2024
Merged

[C-5416] Basic guest checkout behind feature flag#10447
isaacsolo merged 7 commits intomainfrom
is-guest-checkout-feature-flag

Conversation

@isaacsolo
Copy link

Description

Taking the basic parts of the guest checkout demo and putting it behind a feature flag. When feature flag is disabled, clicking buy will redirect to sign up. When it's enabled, it will ask for an email input to be used for guest sign up and purchase.

How Has This Been Tested?

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

Confirmed purchase flow when feature flag is disabled and enabled works as expected.

@changeset-bot
Copy link

changeset-bot bot commented Nov 15, 2024

⚠️ No Changeset found

Latest commit: 2a00dca

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@isaacsolo isaacsolo changed the title Basic guest checkout behind feature flag [C-5416] Basic guest checkout behind feature flag Nov 15, 2024
@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/is-guest-checkout-feature-flag

Copy link
Contributor

@amendelsohn amendelsohn left a comment

Choose a reason for hiding this comment

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

Looks great!

A few concerns before I approve:

  • the hardcoded TempPassword
  • the fetchAccountAsync saga function in the hook file

const isUnlocking = !error && isContentPurchaseInProgress(stage)
const { data: balanceBN } = useUSDCBalance()
const balance = USDC(balanceBN ?? new BN(0)).value
const [guestEmail, setGuestEmail] = useLocalStorage('guest-email', '')
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we want this in localStorage? is it for users who want to make two purchases in the same guest session?

Copy link
Contributor

Choose a reason for hiding this comment

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

also if we keep it in local storage, the key should probably be a constant

Copy link
Author

@isaacsolo isaacsolo Nov 15, 2024

Choose a reason for hiding this comment

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

yup exactly for subsequent purchases ill use that constant key

// guest account secured by OTP
const ownerWallet = await this.hedgehog.signUp({
username: email,
password: 'TemporaryPassword'
Copy link
Contributor

Choose a reason for hiding this comment

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

is it unsafe to have this hard coded in the repo?

if I know someone did guest checkout (e.g. by scanning blocks or whatever) can I find and claim temp accounts with this password?

Copy link
Author

Choose a reason for hiding this comment

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

This is behind a feature flag and even then the account is secured by OTP


const USDC_TOKEN_ADDRESS = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'

export function* fetchAccountAsync({ isSignUp = false }): SagaIterator {
Copy link
Contributor

Choose a reason for hiding this comment

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

this feels like the wrong file for this saga function

>
{showContent ? (
<CoinflowPurchase
email={guestEmail}
Copy link
Contributor

Choose a reason for hiding this comment

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

is this supposed to be the account email if you're not in guest mode?
or is this only used for guest checkout?

Copy link
Author

Choose a reason for hiding this comment

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

if not in guest mode, this will be empty so it'll prompt the user for the email in the coinflow modal. if you've already purchased before, coinflow will remember your email and won't prompt you again for it. good callout! i tested this a couple different ways logged in, new account, with/without.

@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/is-guest-checkout-feature-flag

Copy link
Contributor

@amendelsohn amendelsohn left a comment

Choose a reason for hiding this comment

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

LGTM, please move the fetchAccountAsync fn out of the hook file before merging

@isaacsolo isaacsolo enabled auto-merge (squash) November 15, 2024 22:33
@isaacsolo isaacsolo disabled auto-merge November 15, 2024 22:45
@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/is-guest-checkout-feature-flag

@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/is-guest-checkout-feature-flag

@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/is-guest-checkout-feature-flag

@isaacsolo isaacsolo enabled auto-merge (squash) November 18, 2024 21:37
@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/is-guest-checkout-feature-flag

@isaacsolo isaacsolo disabled auto-merge November 18, 2024 22:13
@isaacsolo isaacsolo merged commit 9a0603f into main Nov 18, 2024
@isaacsolo isaacsolo deleted the is-guest-checkout-feature-flag branch November 18, 2024 22:13
audius-infra pushed a commit that referenced this pull request Nov 23, 2024
[34d450f] QA ticket grab bag (#10514) Raymond Jacobson
[ccb7082] [PAY-3607] Migrate explore tracks to sdk (#10509) Reed
[bb6828e] [PAY-3503] Update no longer can message user UI (#10505) Reed
[80c700e] Revert "[C-5342] Upgrade react-native to 0.75 (#10301)" (#10497) Andrew Mendelsohn
[bb06fba] Fix sidebar playlists account sync (#10495) Isaac Solo
[047598a] [C-5405] Update upload flow with file replace (#10494) Kyle Shanks
[e1bc4ca] [QA-1842] Fix web date picker time default (#10491) Isaac Solo
[2fdfd7b] Remove PREFER_HIGHER_PATCH_FOR_PRIMARY/SECONDARIES feature flags (#10480) Reed
[2736806] [C-5410] Add ReplaceTrackConfirmation modal (#10489) Kyle Shanks
[8c52795] [C-5408] Move delete track action to overflow menu (#10487) Kyle Shanks
[4cfea48] [C-5395 & C-5396] Upgrade to amplitude v2 and enable session replay (#10463) JD Francis
[d6f43a6] Fix watchQueueAutoplay test (#10488) Andrew Mendelsohn
[4d15579] [C-5430] Add feature flag for track audio replace (#10482) Kyle Shanks
[7820db8] Remove AI_ATTRIBUTION feature flag (#10476) Reed
[09ec89b] [C-5404] Add FileReplaceContainer component to web (#10462) Kyle Shanks
[14756ed] Remove DISCOVERY_TIP_REACTIONS feature flag (#10479) Reed
[92eed35] Remove DEVELOPER_APPS_PAGE feature flag (#10477) Reed
[f242d87] Remove SDK_DISCOVERY_NODE_SELECTOR feature flag (#10474) Reed
[ec135ba] Remove LAZY_USERBANK_CREATION_ENABLED feature flag (#10473) Reed
[bc4452e] Remove misc feature flags (#10478) Reed
[980e2b0] Remove RELATED_ARTISTS_ON_PROFILE_ENABLED feature flag (#10475) Reed
[4d76fbe] Remove PODCAST_CONTROL_UPDATES_ENABLED feature flag (#10471) Reed
[914b46b] Remove EARLY_ACCESS feature flag (#10469) Reed
[5d0a9ed] Remove RATE_CTA_ENABLED feature flag (#10467) Reed
[61e9ddf] Remove OFFLINE_MODE_RELEASE feature flag (#10466) Reed
[85fb740] [C-5403, C-5411] Add Upload icon to harmony (#10459) Kyle Shanks
[d51cc3c] [QA-1840] Fix Offline Mode errors (#10460) Andrew Mendelsohn
[9a0603f] [C-5416] Basic guest checkout behind feature flag (#10447) Isaac Solo
[38e007c] [C-5417] Update track audio replace for sdk change (#10458) Kyle Shanks
[8455921] Remove TIPPING_ENABLED feature flag (#10457) Reed
[0403468] Remove SOLANA_LISTEN_ENABLED feature flag (#10456) Reed
[a93a826] Fix track edit sdk issues (#10450) Sebastian Klingler
[5484dac] [QA-1827] Fix queuing short profile lineups issue (#10451) Randy Schott
[c4ef1e0] Fix bad useEffects calls in PremiumContentPurchaseDrawer (#10454) Randy Schott
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants