calcom / cal.com

Scheduling infrastructure for absolutely everyone.
https://cal.com
Other
29.79k stars 6.99k forks source link

[CAL-3745] Onboarding loop & language auto switch bug #14729

Open rufat opened 2 months ago

rufat commented 2 months ago

Issue Summary

I encountered a bug. When I uploaded my profile picture at the onboarding, it navigated me to the dashboard, and then the onboarding started over again. All my settings were saved, so, I quickly returned to the dashboard again by pressing the next button each time.

Also, it is weirdly switching the languages back and forth. also, there are some react minified js errors. I feel lag when I navigate through the pages.

Steps to Reproduce

  1. Sign up with a fresh account
  2. Complete all onboarding steps

Actual Results

  1. The onboarding bug forces me to go over onboarding again.
  2. After onboarding bug, the dashboard switches language between two (default and regional langs) when I use sidebar menu.

Expected Results

  1. Completing onboard at the first attempt.
  2. Seeing the default language.

Technical details

Evidence

image

https://github.com/calcom/cal.com/assets/5330471/e152f853-1a0d-4b47-95a1-13e056e50f20

CAL-3745

dosubot[bot] commented 2 months ago

To tackle the onboarding loop and language auto-switch issues you're experiencing with cal.com, here are some specific steps and insights:

  1. Onboarding Loop: This issue might be due to the application not properly updating or checking the user's onboarding completion status. Investigate the navigation logic in apps/web/pages/getting-started/[[...step]].tsx, focusing on how the currentStepIndex and completion status are managed. Ensure that once the onboarding is completed, a flag is set in the user's profile to prevent re-entry into the onboarding flow.

  2. Language Auto-Switch: The problem could be related to the initialization and persistence of the user's language preference. Check the implementation of the useLocale hook, which should save the language preference (e.g., in local storage or a backend database) and load it upon application startup. This is crucial for maintaining consistent language settings across sessions.

  3. For the React Minified JS Errors, ensure your project's build setup includes source maps to help trace errors back to their original source code. Also, review the use of React features and hooks for potential issues, such as incorrect useEffect dependencies or state updates on unmounted components, which could lead to errors.

Addressing these specific areas should help resolve the issues you're facing.

#### Details **Sources** - [apps/web/components/getting-started/steps-views/UserProfile.tsx](https://github.com/calcom/cal.com/blob/main/apps/web/components/getting-started/steps-views/UserProfile.tsx) - [apps/web/pages/getting-started/[[...step]].tsx](https://github.com/calcom/cal.com/blob/main/apps/web/pages/getting-started/[[...step]].tsx) - [packages/lib/hooks/useLocale.ts](https://github.com/calcom/cal.com/blob/main/packages/lib/hooks/useLocale.ts) - [packages/lib/getLocaleFromRequest.ts](https://github.com/calcom/cal.com/blob/main/packages/lib/getLocaleFromRequest.ts) - [packages/platform/sdk/tsconfig.json](https://github.com/calcom/cal.com/blob/main/packages/platform/sdk/tsconfig.json) - [apps/web/next.config.js](https://github.com/calcom/cal.com/blob/main/apps/web/next.config.js) - [apps/web/pages/settings/my-account/profile.tsx](https://github.com/calcom/cal.com/blob/main/apps/web/pages/settings/my-account/profile.tsx) - [packages/lib/hooks/useOnclickOutside.ts](https://github.com/calcom/cal.com/blob/main/packages/lib/hooks/useOnclickOutside.ts) - [packages/debugging/components/RenderCounter.tsx](https://github.com/calcom/cal.com/blob/main/packages/debugging/components/RenderCounter.tsx) - [apps/storybook/next.config.js](https://github.com/calcom/cal.com/blob/main/apps/storybook/next.config.js) - [apps/web/lib/getting-started/[[...step]]/getServerSideProps.tsx](https://github.com/calcom/cal.com/blob/main/apps/web/lib/getting-started/[[...step]]/getServerSideProps.tsx)
**About Dosu** This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.