Skip to content

feat: skip license page for cloud billing users #41102

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

Merged
merged 1 commit into from
Jul 10, 2025

Conversation

jacquesikot
Copy link
Contributor

@jacquesikot jacquesikot commented Jul 9, 2025

Description

This PR enhances the signup success flow to automatically skip the license page when cloud billing is enabled, providing a smoother onboarding experience for cloud users.

Key Changes

🚀 New Features

  • Added cloud billing detection using useIsCloudBillingEnabled() hook
  • Implemented automatic license page skipping for cloud billing users
  • Enhanced redirect logic with proper async/await handling

🔧 Improvements

  • Added redirect state management to prevent race conditions
  • Improved error handling in redirect flow with try-catch blocks
  • Extracted redirect conditions into shouldAutoRedirect variable for better readability
  • Added redirect protection to prevent multiple simultaneous redirects

🛠️ Technical Details

  • Added isMultiOrgEnabled flag to signup redirect parameters
  • Made redirectUsingQueryParam and onGetStarted functions async
  • Implemented isRedirecting state to track redirect status
  • Added proper dependency management in useEffect and useCallback hooks

Impact

  • Cloud billing users will now bypass the license page automatically
  • Improved UX with more robust redirect handling and loading states
  • Better performance by preventing unnecessary redirect attempts
  • Enhanced reliability with proper error handling and state management

Automation

/ok-to-test tags="@tag.Sanity, @tag.Authentication, @tag.LicenseAndBilling"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/16167808138
Commit: ab4247c
Cypress dashboard.
Tags: @tag.Sanity, @tag.Authentication, @tag.LicenseAndBilling
Spec:


Wed, 09 Jul 2025 12:00:44 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Improved signup success experience with smarter automatic redirection based on user status and organization settings.
    • Added a loading spinner during redirection for better user feedback.
  • Bug Fixes

    • Prevented multiple redirects from occurring at the same time.

@jacquesikot jacquesikot self-assigned this Jul 9, 2025
@jacquesikot jacquesikot added the ok-to-test Required label for CI label Jul 9, 2025
Copy link
Contributor

coderabbitai bot commented Jul 9, 2025

Walkthrough

The SignupSuccess component was refactored to introduce asynchronous control over user redirection, prevent concurrent redirects, and incorporate multi-organization billing status into the redirection logic. State management for redirection was improved, and auto-redirect conditions were consolidated into a single computed flag, with UI feedback provided during redirection.

Changes

File(s) Change Summary
app/client/src/pages/setup/SignupSuccess.tsx Refactored SignupSuccess: added isRedirecting state, made redirectUsingQueryParam and onGetStarted async, introduced shouldAutoRedirect flag and useEffect for auto-redirection, incorporated multi-org billing status, and updated UI to handle redirect state.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SignupSuccess Component
    participant RedirectHelper

    User->>SignupSuccess Component: Loads page
    SignupSuccess Component->>SignupSuccess Component: Compute shouldAutoRedirect
    alt shouldAutoRedirect is true and not isRedirecting
        SignupSuccess Component->>SignupSuccess Component: Set isRedirecting = true
        SignupSuccess Component->>RedirectHelper: redirectUsingQueryParam(isMultiOrgEnabled)
        RedirectHelper-->>SignupSuccess Component: Redirect or error
        SignupSuccess Component->>SignupSuccess Component: Set isRedirecting = false (on error)
    else User clicks "Get Started"
        User->>SignupSuccess Component: Clicks button
        SignupSuccess Component->>SignupSuccess Component: Set isRedirecting = true
        SignupSuccess Component->>RedirectHelper: redirectUsingQueryParam(isMultiOrgEnabled)
        RedirectHelper-->>SignupSuccess Component: Redirect or error
        SignupSuccess Component->>SignupSuccess Component: Set isRedirecting = false (on error)
    end
Loading

Possibly related PRs

Suggested labels

Enhancement

Suggested reviewers

  • ankitakinger
  • trishaanand

Poem

In Signup’s glow, a redirect waits,
Async and careful, it now debates.
Multi-org billing joins the show,
One flag to rule when users go.
With spinners spinning, code refined—
Success now greets both heart and mind!
🚀

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the Enhancement New feature or request label Jul 9, 2025
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)
app/client/src/pages/setup/SignupSuccess.tsx (1)

29-29: Consider aligning variable name with hook semantics

The variable name isMultiOrgEnabled doesn't clearly convey that it's checking cloud billing status. Consider renaming to isCloudBillingEnabled for clarity.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d34336e and ab4247c.

📒 Files selected for processing (1)
  • app/client/src/pages/setup/SignupSuccess.tsx (4 hunks)
🧰 Additional context used
🧠 Learnings (1)
app/client/src/pages/setup/SignupSuccess.tsx (7)
Learnt from: saiprabhu-dandanayak
PR: appsmithorg/appsmith#33911
File: app/client/src/api/TemplatesApi.ts:0-0
Timestamp: 2024-10-08T15:32:39.374Z
Learning: User saiprabhu-dandanayak has confirmed the removal of the `any` type in the TypeScript code for better type safety in the `TemplatesApi.ts` file.
Learnt from: saiprabhu-dandanayak
PR: appsmithorg/appsmith#33911
File: app/client/src/api/TemplatesApi.ts:0-0
Timestamp: 2024-07-26T21:12:57.228Z
Learning: User saiprabhu-dandanayak has confirmed the removal of the `any` type in the TypeScript code for better type safety in the `TemplatesApi.ts` file.
Learnt from: sneha122
PR: appsmithorg/appsmith#30012
File: app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx:679-682
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The user `sneha122` has confirmed the resolution of the feedback regarding the redundancy of `|| false` in the `_.get` expression within the `RestAPIDatasourceForm.tsx` file.
Learnt from: sneha122
PR: appsmithorg/appsmith#30012
File: app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx:679-682
Timestamp: 2024-10-08T15:32:34.115Z
Learning: The user `sneha122` has confirmed the resolution of the feedback regarding the redundancy of `|| false` in the `_.get` expression within the `RestAPIDatasourceForm.tsx` file.
Learnt from: alex-golovanov
PR: appsmithorg/appsmith#39379
File: app/client/src/pages/AppIDE/components/LibrariesList/JSLibrariesSection.tsx:0-0
Timestamp: 2025-02-20T13:36:10.743Z
Learning: When reviewing React components, ensure that useMemo and useEffect hooks include all variables used within their callbacks in their dependency arrays to prevent stale values and potential bugs.
Learnt from: brayn003
PR: appsmithorg/appsmith#38088
File: app/client/src/git/components/GitContextProvider/hooks/useGitBranches.ts:40-43
Timestamp: 2024-12-11T08:25:39.197Z
Learning: In `app/client/src/git/components/GitContextProvider/hooks/useGitBranches.ts`, the `useMemo` hook includes dependencies `artifactType` and `baseArtifactId` in its dependency array.
Learnt from: brayn003
PR: appsmithorg/appsmith#36989
File: app/client/packages/git/src/actions/helpers/createSingleArtifactAction.ts:52-68
Timestamp: 2024-10-21T13:17:59.251Z
Learning: In this codebase, when using Redux Toolkit's createSlice from Redux Toolkit, we can directly mutate the state within reducers since Immer handles immutability internally.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-build / client-build
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (3)
app/client/src/pages/setup/SignupSuccess.tsx (3)

89-94: Good consolidation of redirect conditions

The shouldAutoRedirect variable improves code readability by clearly expressing when automatic redirection should occur.


96-100: Well-implemented auto-redirect logic

The useEffect properly handles automatic redirection with appropriate guard conditions to prevent race conditions.


110-116: Correct implementation of loading state

Good change from imperative redirect call to declarative condition check. The loading spinner provides appropriate user feedback during redirection.

Comment on lines +60 to +69
}, [
dispatch,
isNonInvitedUser,
isOnLoginPage,
redirectUrl,
shouldEnableFirstTimeUserOnboarding,
validLicense,
isAiAgentInstanceEnabled,
isMultiOrgEnabled,
]);
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

Fix useCallback dependency array

The dependency array includes isNonInvitedUser which isn't used in the callback. Also missing isRedirecting which is used in the function.

  }, [
    dispatch,
-   isNonInvitedUser,
+   isRedirecting,
    isOnLoginPage,
    redirectUrl,
    shouldEnableFirstTimeUserOnboarding,
    validLicense,
    isAiAgentInstanceEnabled,
    isMultiOrgEnabled,
  ]);
📝 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
}, [
dispatch,
isNonInvitedUser,
isOnLoginPage,
redirectUrl,
shouldEnableFirstTimeUserOnboarding,
validLicense,
isAiAgentInstanceEnabled,
isMultiOrgEnabled,
]);
}, [
dispatch,
isRedirecting,
isOnLoginPage,
redirectUrl,
shouldEnableFirstTimeUserOnboarding,
validLicense,
isAiAgentInstanceEnabled,
isMultiOrgEnabled,
]);
🤖 Prompt for AI Agents
In app/client/src/pages/setup/SignupSuccess.tsx around lines 60 to 69, the
useCallback dependency array incorrectly includes isNonInvitedUser which is not
used inside the callback, and it is missing isRedirecting which is used. Remove
isNonInvitedUser from the dependency array and add isRedirecting to ensure the
dependencies accurately reflect the variables used in the callback function.

});
await redirectUsingQueryParam();
},
[redirectUsingQueryParam],
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

Add missing dependency to useCallback

The dispatch function is used within the callback but missing from the dependency array.

-   [redirectUsingQueryParam],
+   [redirectUsingQueryParam, dispatch],
📝 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
[redirectUsingQueryParam],
[redirectUsingQueryParam, dispatch],
🤖 Prompt for AI Agents
In app/client/src/pages/setup/SignupSuccess.tsx at line 86, the useCallback
hook's dependency array is missing the 'dispatch' function, which is used inside
the callback. Add 'dispatch' to the dependency array to ensure the callback
updates correctly when 'dispatch' changes.

@jacquesikot jacquesikot merged commit 7282f64 into release Jul 10, 2025
48 checks passed
@jacquesikot jacquesikot deleted the feat/skip-license-page-for-cloud-billing branch July 10, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request ok-to-test Required label for CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants