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

fix: is onboarding ready evaluation #4165

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

fix: is onboarding ready evaluation #4165

wants to merge 5 commits into from

Conversation

sshanzel
Copy link
Member

@sshanzel sshanzel commented Feb 7, 2025

Changes

  • Fixes the issue where pages automatically redirect to onboarding if a user is anonymous.
  • The problem with the variable was that it checks whether onboarding is now "ready", but onboarding starts as an anonymous user, and with previous evaluation, while anonymous user, it can be false (trying to register), hence, an edge case was found.
  • To make it clearer, we are going to separate the concerns by reverting the useOnboarding hook to its original form and introduce a new one that will handle the evaluation of actions performed related to onboarding.

Events

Did you introduce any new tracking events?

Experiment

Did you introduce any new experiments?

Manual Testing

Caution

Please make sure existing components are not breaking/affected by this PR

Preview domain

https://fix-isonboarding.preview.app.daily.dev

Copy link

vercel bot commented Feb 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
daily-webapp ✅ Ready (Inspect) Visit Preview Feb 7, 2025 3:32pm
1 Skipped Deployment
Name Status Preview Updated (UTC)
storybook ⬜️ Ignored (Inspect) Feb 7, 2025 3:32pm

@sshanzel
Copy link
Member Author

sshanzel commented Feb 7, 2025

I will run the critical flows both on preview and prod deployment 🙏

}, [
isOnboardingReady,
router,
Copy link
Member Author

Choose a reason for hiding this comment

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

Router has been known to an unstable dependency, hence removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

its not unstable since we upgraded to next 14 code, it no longer changes on each render, it only changes when page changes, which is supposed to happen

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, finally. It is quite annoying to have them commented in the past.

Copy link
Contributor

@capJavert capJavert left a comment

Choose a reason for hiding this comment

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

I am not 100% what is happening, its a bit hard to parse the code, from what I see the issue was that isOnboardingReady changed so it also redirected on some other pages like profile. That part I see its fixed on preview 👌

completeStep: (action: ActionType) => void;
}

export const useOnboardingActions = (): UseOnboardingActions => {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we move it to separate hook file?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not really sure this is the right fix though...
Why can't we just export the way it was and inside onboarding add that 1 extra variable?

Isn't that the same result, but without having to copy a whole hook?

@@ -78,15 +80,17 @@ function InternalApp({ Component, pageProps, router }: AppProps): ReactElement {

useEffect(() => {
if (
isOnboardingReady &&
isOnboardingActionsReady &&
Copy link
Contributor

Choose a reason for hiding this comment

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

I mean here, why don't we just do isOnboardingReady && !user (or whatever we changed in the hook)

Copy link
Member Author

Choose a reason for hiding this comment

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

The problem with that then is the isAuthReady can still be false. I've updated everything now to make it simpler.

@sshanzel
Copy link
Member Author

sshanzel commented Feb 7, 2025

@rebelchris @capJavert I've updated it to make the affected changes smaller. They are basically the same previously but kept within the same hook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants