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

[PAY-3748] Fix logged out state #10871

Closed
wants to merge 1 commit into from
Closed

[PAY-3748] Fix logged out state #10871

wants to merge 1 commit into from

Conversation

raymondjacobson
Copy link
Member

@raymondjacobson raymondjacobson commented Dec 31, 2024

Description

Even when in a logged out state, we need a hedgehog wallet.
Main change in this PR is to not throw in sdk, but create a wallet object with a throwaway password.

Also fix some minor svg browser errors along the way

How Has This Been Tested?

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

  • Trending loads when logged out now
  • Able to log in

Copy link

changeset-bot bot commented Dec 31, 2024

⚠️ No Changeset found

Latest commit: 279c614

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

@@ -83,14 +83,14 @@ const ${variables.componentName} = forwardRef((${variables.props}, ref) => {
other.width = width
}

const fillColor = other.fill ?? theme.color?.icon[color] ?? 'red'
const fillcolor = other.fill ?? theme.color?.icon[color] ?? 'red'
Copy link
Member Author

Choose a reason for hiding this comment

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

fillcolor is right not fillColor

@@ -63,7 +63,6 @@ export const BaseButton = forwardRef<HTMLButtonElement, BaseButtonProps>(
userSelect: 'none',
whiteSpace: 'nowrap',
paddingInline: 0,
'-webkit-padding': 0,
Copy link
Member Author

Choose a reason for hiding this comment

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

afaik, this is not actually a thing

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here btw, but all good

@@ -3,7 +3,7 @@ module.exports = {
titleProp: true,
descProp: true,
replaceAttrValues: {
red: '{props.fillColor}',
'#FF0000': '{props.fillColor}'
red: '{props.fillcolor}',
Copy link
Contributor

Choose a reason for hiding this comment

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

Heads up I fix this in an open pr, mind dropping?

Copy link
Member Author

Choose a reason for hiding this comment

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

yea

@@ -63,7 +63,6 @@ export const BaseButton = forwardRef<HTMLButtonElement, BaseButtonProps>(
userSelect: 'none',
whiteSpace: 'nowrap',
paddingInline: 0,
'-webkit-padding': 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here btw, but all good

Copy link
Contributor

@rickyrombo rickyrombo left a comment

Choose a reason for hiding this comment

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

This is probably a philosophical nitpick but I would really like to move away from the model of having dummy wallets doing signatures. I think it's super weird conceptually - the whole idea of signatures should be to prove you are a certain wallet and thus a certain user, but that doesn't really make sense for these dummy wallets.

Conceptually, anyone should be able to use Audius (and the SDK) without a (user) wallet. Like, not that we will make a wallet for you behind the scenes (that our backend won't recognize anyway), but entirely without a wallet.

What's more is dummy wallets make it hard to reason about the wallet that is doing things - should we use this wallet in create user things? Probably not! We want consumers of SDK to ensure the wallets that they use for users are protected by good passwords etc, not just whatever default wallet we spit back out automatically with this timestamp seed. Throwing in this case would help prevent accidental mishaps there.

This PR also doesn't address the main cause of the weird logged out state bug, which in my opinion isn't that we don't have a wallet, but rather that we're trying to sign something without having a wallet.

I propose fixing that here (we can quibble on the impl and logging but this is the gist) and leaving the throwing behavior as-is: #10873

ETA: I won't die on this hill, if we really don't like the throwing behavior feel free to merge as-is

Copy link
Contributor

@schottra schottra left a comment

Choose a reason for hiding this comment

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

Good catch

@raymondjacobson
Copy link
Member Author

This is probably a philosophical nitpick but I would really like to move away from the model of having dummy wallets doing signatures. I think it's super weird conceptually - the whole idea of signatures should be to prove you are a certain wallet and thus a certain user, but that doesn't really make sense for these dummy wallets.

Conceptually, anyone should be able to use Audius (and the SDK) without a (user) wallet. Like, not that we will make a wallet for you behind the scenes (that our backend won't recognize anyway), but entirely without a wallet.

What's more is dummy wallets make it hard to reason about the wallet that is doing things - should we use this wallet in create user things? Probably not! We want consumers of SDK to ensure the wallets that they use for users are protected by good passwords etc, not just whatever default wallet we spit back out automatically with this timestamp seed. Throwing in this case would help prevent accidental mishaps there.

This PR also doesn't address the main cause of the weird logged out state bug, which in my opinion isn't that we don't have a wallet, but rather that we're trying to sign something without having a wallet.

I propose fixing that here (we can quibble on the impl and logging but this is the gist) and leaving the throwing behavior as-is: #10873

ETA: I won't die on this hill, if we really don't like the throwing behavior feel free to merge as-is

I think this analysis is wrong, but the outcome is something I agree with!
the app is designed w/ the assumption that there is always a wallet + hedgehog entropy. maybe that's the wrong assumption, but as part of migrating from libs->sdk, maintaining that assumption seems right to me. I like your solution if it is that simple:

#10873 (review)

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.

4 participants