-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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: Bug where identifyUser not called in cloud #37329
Conversation
WalkthroughThe changes in this pull request focus on the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
app/client/src/utils/AppsmithUtils.tsx
(1 hunks)
🔇 Additional comments (1)
app/client/src/utils/AppsmithUtils.tsx (1)
101-101
: LGTM! Proper async/await handling added.
The addition of await
ensures that segment initialization completes before proceeding, fixing the original issue.
Also applies to: 104-104
|
||
if ( | ||
!currentUser.isAnonymous && | ||
currentUser.username !== ANONYMOUS_USERNAME | ||
) { | ||
await AnalyticsUtil.identifyUser(currentUser); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
User identification is duplicated in HelpButton.tsx
Found another instance of identifyUser
being called in app/client/src/pages/Editor/HelpButton.tsx
. This could lead to duplicate user identification.
app/client/src/utils/AppsmithUtils.tsx
: Main identification callapp/client/src/pages/Editor/HelpButton.tsx
: Duplicate identification call withsendAdditionalData
flag
🔗 Analysis chain
LGTM! User identification logic properly placed.
The user identification is now correctly placed within the analytics setup try-catch block and executes after segment initialization.
Let's verify that this is the only place where user identification is called:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for other occurrences of identifyUser to ensure we're not duplicating the call
rg "identifyUser" --type ts --type tsx
Length of output: 66
Script:
#!/bin/bash
# Search for identifyUser occurrences using ripgrep with correct file type options
rg "identifyUser" -t ts -t tsx -t js -t jsx
Length of output: 71
Script:
#!/bin/bash
# Search for identifyUser using basic ripgrep without file type filters
rg "identifyUser"
# Also search for the AnalyticsUtil class usage
rg "AnalyticsUtil"
Length of output: 78941
## Description Fix the bug where return was called before the await for cloud conditions. This made the identifyUser case being skipped almost always Missed in appsmithorg#37303 ## Automation /ok-to-test tags="@tag.Sanity" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!IMPORTANT] > 🟣 🟣 🟣 Your tests are running. > Tests running at: <https://github.com/appsmithorg/appsmith/actions/runs/11791461362> > Commit: 94bc989 > Workflow: `PR Automation test suite` > Tags: `@tag.Sanity` > Spec: `` > <hr>Tue, 12 Nov 2024 05:44:55 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced analytics initialization process to ensure completion before user identification. - **Bug Fixes** - Improved error handling for analytics setup with Sentry logging. - **Documentation** - Updated function signatures for clarity and consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description
Fix the bug where return was called before the await for cloud conditions. This made the identifyUser case being skipped almost always
Missed in #37303
Automation
/ok-to-test tags="@tag.Sanity"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11791461362
Commit: 94bc989
Cypress dashboard.
Tags:
@tag.Sanity
Spec:
Tue, 12 Nov 2024 06:23:58 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Bug Fixes
Documentation