Skip to content

fix: team selection race condition in template customization (NES-1465)#8882

Open
up-tandem wants to merge 6 commits intomainfrom
up/nes-1465-email-template-bugs-with-email-field-and-team-selection
Open

fix: team selection race condition in template customization (NES-1465)#8882
up-tandem wants to merge 6 commits intomainfrom
up/nes-1465-email-template-bugs-with-email-field-and-team-selection

Conversation

@up-tandem
Copy link
Contributor

@up-tandem up-tandem commented Mar 19, 2026

Summary

  • Fixed two root causes of journeys being duplicated to the wrong team during template customization:
    1. Formik's enableReinitialize silently reset the user's team selection whenever async data re-rendered the component
    2. handleJourneyDuplication ignored the form's teamSelect value and always used lastActiveTeamId from the server
  • Added loading gate so the form only renders once both team and journey data are available
  • Validates lastActiveTeamId against available teams (falls back to first team if stale/deleted)
  • Persists selected team as lastActiveTeamId after successful duplication (fire-and-forget)
  • Removed setActiveTeam side effect from team dropdown onChange to prevent mid-flow re-renders
  • Added try/catch around duplication to prevent frozen loading state on network errors

Testing

  • 4 new tests: stale team fallback, updateLastActiveTeamId after duplication, network error handling, user-selected team honored over lastActiveTeamId
  • Updated existing tests to account for loading gate (async data must resolve before form renders)
  • All 15 LanguageScreen tests pass
  • All 3 JourneyCustomizeTeamSelect tests pass

Post-Deploy Monitoring & Validation

  • What to monitor/search
    • Logs: journeyDuplicate mutation errors in Datadog/logging
    • Metrics: Journey duplication success rate, journeyProfileUpdate mutation call rate
  • Expected healthy behavior
    • Users report journeys landing in the correct team
    • No increase in duplication errors
  • Failure signal(s) / rollback trigger
    • Users report journeys still going to wrong team → revert this PR
    • Increase in "Failed to duplicate journey" snackbar errors → investigate
  • Validation window & owner
    • Window: 48 hours post-deploy
    • Owner: Ekkasit (Up)

Linear Issue

NES-1465


🤖 Generated with Claude Opus 4.6 (1M context) via Claude Code

Summary by CodeRabbit

  • New Features

    • Shows a loading spinner while teams/journey load and displays "Failed to load teams. Please refresh the page and try again." on error.
    • Falls back to the first available team when your last-active team no longer exists.
  • Bug Fixes

    • Duplication uses the team you explicitly select and updates your last-active team.
    • Clearer duplication error handling: shows failure message and re-enables Next after network failures.
  • Tests

    • Expanded coverage for duplication flow, team-selection fallback, update-after-duplication, and network-error handling.

Journey duplication was sending users' journeys to the wrong team due to
two bugs: (1) Formik's enableReinitialize silently reset the team select
value whenever async data re-rendered the component, and (2) the
handleJourneyDuplication function ignored the form value entirely and
always used lastActiveTeamId from the server.

- Remove enableReinitialize; gate form render on data readiness
- Pass user's selected team from form values to duplication mutation
- Validate lastActiveTeamId against available teams (stale ID fallback)
- Persist selected team as lastActiveTeamId after successful duplication
- Remove setActiveTeam side effect from team dropdown onChange
- Add try/catch around duplication to prevent frozen loading state

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@linear
Copy link

linear bot commented Mar 19, 2026

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Agent 2 - UI Engineer seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: fixing a team selection race condition in template customization, with ticket reference NES-1465.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch up/nes-1465-email-template-bugs-with-email-field-and-team-selection
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Mar 19, 2026

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit fc26c66

Command Status Duration Result
nx run journeys-e2e:e2e ❌ Failed 3m 21s View ↗
nx run journeys-admin-e2e:e2e ✅ Succeeded 32s View ↗
nx run watch-e2e:e2e ✅ Succeeded 23s View ↗
nx run player-e2e:e2e ✅ Succeeded 3s View ↗
nx run resources-e2e:e2e ✅ Succeeded 9s View ↗
nx run videos-admin-e2e:e2e ✅ Succeeded 4s View ↗
nx run watch-modern-e2e:e2e ✅ Succeeded 3s View ↗
nx run-many --target=vercel-alias --projects=jo... ✅ Succeeded 2s View ↗
Additional runs (20) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-03-20 08:08:16 UTC

@github-actions github-actions bot temporarily deployed to Preview - journeys-admin March 19, 2026 21:23 Inactive
@up-tandem up-tandem self-assigned this Mar 19, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Fri Mar 20 21:02:04 NZDT 2026

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.tsx`:
- Around line 54-55: The current loading gate (const isDataReady = query?.data
!= null && journey != null in LanguageScreen) only detects missing data and
leaves the UI spinning when the team query errors; update the guard to also
check for query.error or query.isError and handle it by returning an
error/fallback UI with retry (or call a provided refetch) instead of the
spinner. Locate the isDataReady usage and the render path in LanguageScreen (and
the similar guard around lines referenced 303-333) and add an early branch that
renders an error message and a retry action when query.error is present,
otherwise proceed with the existing loading/data rendering logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 92f201b9-2d0b-4bba-bb0b-6a66192d6686

📥 Commits

Reviewing files that changed from the base of the PR and between 59e65ef and a90ee79.

📒 Files selected for processing (3)
  • apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/JourneyCustomizeTeamSelect/JourneyCustomizeTeamSelect.tsx
  • apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.spec.tsx
  • apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.tsx

…eanup

- Define LanguageFormValues interface replacing FormikValues (Record<string, any>)
- Add error state UI when team query fails (prevents infinite spinner)
- Add null guard for journey.language.id (removes unsafe `as string` cast)
- Collapse duplicate if/else branches in handleSubmit
- Remove unnecessary Boolean() wrapper in shouldSkipDuplicate

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin March 19, 2026 21:59 Inactive
LanguageFormValues.languageSelect.id was typed as string | undefined but
LanguageAutocomplete expects string. Default id to '' in initialValues and
align interface with LanguageOption (id: string, optional localName/nativeName).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin March 20, 2026 02:38 Inactive
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.tsx (1)

226-226: Minor: Redundant setLoading(false) call.

This setLoading(false) is now redundant since handleSubmit wraps the call in a try/catch/finally that sets setLoading(false) in the finally block (line 297). Consider removing for clarity.

Suggested fix
         enqueueSnackbar(
           t('Unable to create guest user. Please try again or sign in.'),
           { variant: 'error' }
         )
-        setLoading(false)
         return null
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.tsx`
at line 226, Remove the redundant setLoading(false) call inside the
LanguageScreen submission flow; locate the duplicate call in the same function
that invokes handleSubmit and delete it because handleSubmit already ensures
setLoading(false) in its finally block, so keep the one in handleSubmit (the
finally block) and remove the earlier redundant setLoading(false) to avoid
confusion.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.tsx`:
- Line 226: Remove the redundant setLoading(false) call inside the
LanguageScreen submission flow; locate the duplicate call in the same function
that invokes handleSubmit and delete it because handleSubmit already ensures
setLoading(false) in its finally block, so keep the one in handleSubmit (the
finally block) and remove the earlier redundant setLoading(false) to avoid
confusion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c6de3634-ed93-472b-8156-a56068f5c1f4

📥 Commits

Reviewing files that changed from the base of the PR and between 0892a0c and 3e744ff.

📒 Files selected for processing (1)
  • apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.tsx

@up-tandem up-tandem requested a review from Ur-imazing March 20, 2026 02:43
Agent 2 - UI Engineer and others added 2 commits March 20, 2026 07:52
Replace onClick={() => {}} with onClick={undefined} on disabled
buttons in the loading and error states to satisfy no-empty-function.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…plate-bugs-with-email-field-and-team-selection
@github-actions github-actions bot requested a deployment to Preview - journeys-admin March 20, 2026 07:54 Pending
@stage-branch-merger
Copy link

I see you added the "on stage" label, I'll get this merged to the stage branch!

@github-actions github-actions bot temporarily deployed to Preview - watch-modern March 20, 2026 07:58 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys March 20, 2026 07:58 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin March 20, 2026 07:58 Inactive
@github-actions github-actions bot temporarily deployed to Preview - watch March 20, 2026 07:58 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin March 20, 2026 07:58 Inactive
@github-actions github-actions bot temporarily deployed to Preview - player March 20, 2026 07:58 Inactive
@github-actions github-actions bot temporarily deployed to Preview - resources March 20, 2026 07:58 Inactive
@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch-modern ✅ Ready watch-modern preview Fri Mar 20 21:00:05 NZDT 2026

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
player ✅ Ready player preview Fri Mar 20 21:00:12 NZDT 2026

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Fri Mar 20 21:00:36 NZDT 2026

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Fri Mar 20 21:01:00 NZDT 2026

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
resources ✅ Ready resources preview Fri Mar 20 21:01:15 NZDT 2026

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch ✅ Ready watch preview Fri Mar 20 21:01:14 NZDT 2026

@blacksmith-sh
Copy link
Contributor

blacksmith-sh bot commented Mar 20, 2026

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
src/e2e/journeys.spec.ts/journeys View Logs

Fix in Cursor

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.spec.tsx (1)

1149-1195: Add a regression test for the team-query error screen.

This file now covers duplication failures, but the new hasTeamLoadError early return in LanguageScreen.tsx still isn’t exercised. A GET_LAST_ACTIVE_TEAM_ID_AND_TEAMS mock with error plus assertions on the failure copy and disabled Next button would lock down the spinner fix too.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.spec.tsx`
around lines 1149 - 1195, Add a regression test that triggers the new
hasTeamLoadError early-return in LanguageScreen by providing a MockedProvider
mock for GET_LAST_ACTIVE_TEAM_ID_AND_TEAMS that returns an error; render
LanguageScreen (same setup as existing tests), wait for the error UI copy to
appear (the team-query failure message) and assert the "CustomizeFlowNextButton"
is disabled (or shows the spinner state) to ensure the team-load error path and
spinner fix are exercised; reference the GET_LAST_ACTIVE_TEAM_ID_AND_TEAMS mock
and the hasTeamLoadError behavior in LanguageScreen when adding the new test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.tsx`:
- Around line 327-329: The error message shown in LanguageScreen is not
announced to assistive tech; update the element rendering the failure (the
Typography instance in LanguageScreen) to be accessible by either adding
role="alert" to that Typography or replacing it with MUI's Alert component
(importing Alert from `@mui/material`) so screen readers immediately announce the
load failure.
- Around line 210-218: The guest duplication branch in handleJourneyDuplication
delegates to createGuestUser(), which returns getJourneyProfile.lastActiveTeamId
without verifying that the id exists in query.data.teams; update the guest
branch to validate the returned teamId against the current teams list
(query.data.teams) and, if it's missing/stale, fall back to the same fallback
used for signed-in users (e.g., use values.teamSelect or the first available
team id or undefined) before proceeding with duplication; reference
handleJourneyDuplication, createGuestUser, getJourneyProfile.lastActiveTeamId,
and query.data.teams when making this change.

---

Nitpick comments:
In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.spec.tsx`:
- Around line 1149-1195: Add a regression test that triggers the new
hasTeamLoadError early-return in LanguageScreen by providing a MockedProvider
mock for GET_LAST_ACTIVE_TEAM_ID_AND_TEAMS that returns an error; render
LanguageScreen (same setup as existing tests), wait for the error UI copy to
appear (the team-query failure message) and assert the "CustomizeFlowNextButton"
is disabled (or shows the spinner state) to ensure the team-load error path and
spinner fix are exercised; reference the GET_LAST_ACTIVE_TEAM_ID_AND_TEAMS mock
and the hasTeamLoadError behavior in LanguageScreen when adding the new test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: dcd67494-347c-40e2-aa2f-202718b0b7a8

📥 Commits

Reviewing files that changed from the base of the PR and between 1253ecc and fc26c66.

📒 Files selected for processing (3)
  • apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.spec.tsx
  • apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.tsx
  • libs/locales/en/journeys-ui.json
✅ Files skipped from review due to trivial changes (1)
  • libs/locales/en/journeys-ui.json

Comment on lines 210 to 218
async function handleJourneyDuplication(
type: 'signedIn' | 'guest',
journeyId: string
journeyId: string,
selectedTeamId?: string
): Promise<string | null> {
let teamId
if (type === 'signedIn') {
const teams = query?.data?.teams ?? []
teamId = query?.data?.getJourneyProfile?.lastActiveTeamId ?? teams[0]?.id
teamId = selectedTeamId
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Guest duplication still bypasses the stale-team fallback.

The signed-in path now respects values.teamSelect, but the guest branch still delegates to createGuestUser(), and that helper returns getJourneyProfile.lastActiveTeamId without checking that the id still exists in query.data.teams. Anonymous users with a deleted/stale profile id can still duplicate into the wrong or nonexistent team.

🐛 Suggested fix
 async function createGuestUser(): Promise<{ teamId: string }> {
   const teamName = t('My Team')
   const isAnonymous = user?.isAnonymous ?? false
   if (!isAnonymous) {
     try {
       await signInAnonymously(getAuth(getApp()))
@@
   await loadUser()

   const existingTeams = query?.data?.teams ?? []
-  if (existingTeams.length > 0) {
-    const teamId =
-      query?.data?.getJourneyProfile?.lastActiveTeamId ?? existingTeams[0].id
-    return { teamId }
+  if (existingTeams.length > 0 && defaultTeamId !== '') {
+    return { teamId: defaultTeamId }
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.tsx`
around lines 210 - 218, The guest duplication branch in handleJourneyDuplication
delegates to createGuestUser(), which returns getJourneyProfile.lastActiveTeamId
without verifying that the id exists in query.data.teams; update the guest
branch to validate the returned teamId against the current teams list
(query.data.teams) and, if it's missing/stale, fall back to the same fallback
used for signed-in users (e.g., use values.teamSelect or the first available
team id or undefined) before proceeding with duplication; reference
handleJourneyDuplication, createGuestUser, getJourneyProfile.lastActiveTeamId,
and query.data.teams when making this change.

Comment on lines +327 to +329
<Typography color="error" align="center">
{t('Failed to load teams. Please refresh the page and try again.')}
</Typography>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Announce the load failure to assistive tech.

This replaces the spinner asynchronously, but plain Typography won’t be announced when it appears. Add role="alert" here or switch to MUI Alert so screen-reader users get the failure immediately.

♿ Suggested tweak
-          <Typography color="error" align="center">
+          <Typography color="error" align="center" role="alert">
             {t('Failed to load teams. Please refresh the page and try again.')}
           </Typography>

As per coding guidelines, apps/**/*.{js,jsx,ts,tsx}: Implement accessibility features on elements.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Typography color="error" align="center">
{t('Failed to load teams. Please refresh the page and try again.')}
</Typography>
<Typography color="error" align="center" role="alert">
{t('Failed to load teams. Please refresh the page and try again.')}
</Typography>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.tsx`
around lines 327 - 329, The error message shown in LanguageScreen is not
announced to assistive tech; update the element rendering the failure (the
Typography instance in LanguageScreen) to be accessible by either adding
role="alert" to that Typography or replacing it with MUI's Alert component
(importing Alert from `@mui/material`) so screen readers immediately announce the
load failure.

@up-tandem up-tandem requested review from csiyang and removed request for Ur-imazing March 24, 2026 01:29
@csiyang csiyang removed the on stage label Mar 24, 2026
const { loadUser } = useCurrentUserLazyQuery()
const [teamCreate] = useTeamCreateMutation()
const [loading, setLoading] = useState(false)
const isDataReady = query?.data != null && journey != null
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Purely checking if the data is not null has the downside of showing loading state even if something errors out. We can consider using query.loading for some better checks.

const teams = query?.data?.teams ?? []
const lastActiveTeamId =
query?.data?.getJourneyProfile?.lastActiveTeamId ?? ''
const defaultTeamId = teams.some((t) => t.id === lastActiveTeamId)
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to QA to check that team select is still hidden for a guest

Comment on lines +327 to +329
<Typography color="error" align="center">
{t('Failed to load teams. Please refresh the page and try again.')}
</Typography>
Copy link
Contributor

Choose a reason for hiding this comment

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

Only the stuff inside really needs to be added, all of the other wrappers shouldnt get redefined, so we dont accidentally make inconsistent changes. Do the same for the circular progress

Comment on lines -260 to -273
if (shouldSkipDuplicate(journey, values)) {
// Skips journey duplicate
handleNext()
} else if (isSignedIn) {
// Duplicates journey for a signed in user
const duplicatedJourneyId = await handleJourneyDuplication(
'signedIn',
journeyId
)
return data.journeyDuplicate.id
}

if (duplicatedJourneyId != null) {
handleNext(duplicatedJourneyId)
} else {
setLoading(false)
Copy link
Contributor

Choose a reason for hiding this comment

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

This will also need some regression testing for guests

@jianwei1 jianwei1 assigned jianwei1 and unassigned up-tandem Mar 24, 2026
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.

4 participants