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

Get sign in/out working end to end#1739

Merged
raymondjacobson merged 2 commits into
mainfrom
rj-signinout
Aug 18, 2022
Merged

Get sign in/out working end to end#1739
raymondjacobson merged 2 commits into
mainfrom
rj-signinout

Conversation

@raymondjacobson

@raymondjacobson raymondjacobson commented Aug 18, 2022

Copy link
Copy Markdown
Member

Description

Ended up struggling to test sign up stuff without sign out, so I went ahead in that direction. Hopefully didn't steal too much.

Curious for thoughts here. I believe this is "shippable" with the sagas on mobile enabled at this point. That might save us some pain of having everything be off & then on while we're working.

This is all a good learning exercise for me. I'm starting to get the feeling that we're doing an "in then back out" approach to things.

  1. Mirror dispatch & fetch logic in core stuff like account/sign in (double dispatch/select)
  2. Move all the "inner pages" onto the local redux store instead of common
  3. Go back to the core stuff and remove the web dispatch/select stuff
    Maybe this was already obvious to folks...
Simulator.Screen.Recording.-.iPhone.13.-.2022-08-18.at.00.29.13.mp4

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.

Local simulator

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.

@audius-infra

Copy link
Copy Markdown
Collaborator

Preview this change https://demo.audius.co/rj-signinout

1 similar comment
@audius-infra

Copy link
Copy Markdown
Collaborator

Preview this change https://demo.audius.co/rj-signinout

@sliptype sliptype 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 good! your thinking makes sense, we are gonna have to have the "mirroring" until we drop the webview entirely and then can get rid of it

Also I'm on board with keeping the sagas enabled, but let's keep an eye on perf

const sagaMiddleware = createSagaMiddleware({ context: storeContext })
const middlewares = applyMiddleware(sagaMiddleware)
const composeEnhancers = composeWithDevTools({ trace: true, traceLimit: 25 })
const composeEnhancers = composeWithDevTools({ trace: true, traceLimit: 250 })

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.

Yes

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.

nicee thank heavens


const signedIn = signOnStatus === 'success'
const isSigninError = passwordFieldValue.error
const emailIsAvailable = emailFieldValue.error !== 'inUse'

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.

Is there a reason we aren't using selectors for these anymore? If so can we delete the selectors?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

these are derived values from the result of the selector

// config
...backendSagas(),
// ...accountSagas(),
...accountSagas(),

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.

Did you notice any worse perf with everything enabled like this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Across the app no. There's a slight hiccup when pressing the sign in button, but i think fix-forward makes sense for it. Can disable if it's a bad call once it's on the staging app

@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.

awesome changes man, this is happening


const handleSignOut = useCallback(() => {
dispatchWeb(signOut)
dispatch(signOut({}))

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.

just wondering why we need empty args on this one

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ts was complaining b/c it's an action creator vs. some js garbo actions. both technically work, but this is more "correct" and I didn't want to change the other

const sagaMiddleware = createSagaMiddleware({ context: storeContext })
const middlewares = applyMiddleware(sagaMiddleware)
const composeEnhancers = composeWithDevTools({ trace: true, traceLimit: 25 })
const composeEnhancers = composeWithDevTools({ trace: true, traceLimit: 250 })

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.

nicee thank heavens

) => {},
showPushNotificationConfirmation: () => {}
showPushNotificationConfirmation: () => {},
resetAccount: () => {

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

const audiusBackendInstance = yield* getContext('audiusBackendInstance')
const localStorage = yield* getContext('localStorage')
yield takeLatest(signOutAction.type, function* () {
yield put(resetAccount())

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.

was this just a bug you were seeing overall?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah, present on web too, but less impactful

@audius-infra

Copy link
Copy Markdown
Collaborator

Preview this change https://demo.audius.co/rj-signinout

@raymondjacobson raymondjacobson merged commit 898fc0a into main Aug 18, 2022
@raymondjacobson raymondjacobson deleted the rj-signinout branch August 18, 2022 18:39
audius-infra pushed a commit that referenced this pull request Aug 20, 2022
[8caef33] [PAY-564] Enable LayoutAnimation on android for profile screen (#1754) Reed
[03c2e3d] [C-860] Fix failing mac ci build due to peer deps (#1749) Sebastian Klingler
[a88f8c0] Move Coinbase button into its own component (#1741) Marcus Pasell
[6c204c6] [C-859] Omit `is_verified` from metadata that gets stored in user cache from fetchCID (#1750) Sebastian Klingler
[03eba06] Add bounds to $AUDIO purchase (#1744) Marcus Pasell
[885202d] Bump iOS build (#1748) Michael Piazza
[d035b6d] v1.3.0 (#1740) Sebastian Klingler
[53128be] Update @audius/sdk to 0.0.37 (#1747) Sebastian Klingler
[992d243] Fix twitter share copy (#1746) Michael Piazza
[f783bf6] [PAY-540] Add analytics to buy audio flow (#1673) Marcus Pasell
[898fc0a] Get sign in/out working end to end (#1739) Raymond Jacobson
[94686ef] Bump ios version (#1742) Sebastian Klingler
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.

5 participants