chore: ce changes decoupled mixpannel chunk (#36979)
## Description Decoupled mixpanel script it takes about 50Kb zipped, reduces main chunk by about 2.7%. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/11417674158> > Commit: 7288e912d63f4eee0ee2532934ccf4ae51cc1fff > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11417674158&attempt=2" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Sat, 19 Oct 2024 17:20:19 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 user identification for analytics tracking, ensuring accurate data collection. - Updated user data handling in the HelpButton component to manage consent asynchronously. - **Bug Fixes** - Improved clarity and control flow in user identification logic for analytics. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
9a315eabdc
commit
631abe8e96
|
|
@ -1,4 +1,4 @@
|
||||||
import { call, put, race, select, take } from "redux-saga/effects";
|
import { call, fork, put, race, select, take } from "redux-saga/effects";
|
||||||
import type {
|
import type {
|
||||||
ReduxAction,
|
ReduxAction,
|
||||||
ReduxActionWithPromise,
|
ReduxActionWithPromise,
|
||||||
|
|
@ -190,18 +190,27 @@ export function* getCurrentUserSaga(action?: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function* intializeSmartLook(currentUser: User) {
|
||||||
|
if (!currentUser.isAnonymous && currentUser.username !== ANONYMOUS_USERNAME) {
|
||||||
|
yield AnalyticsUtil.identifyUser(currentUser);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function* runUserSideEffectsSaga() {
|
export function* runUserSideEffectsSaga() {
|
||||||
const currentUser: User = yield select(getCurrentUser);
|
const currentUser: User = yield select(getCurrentUser);
|
||||||
const { enableTelemetry } = currentUser;
|
const { enableTelemetry } = currentUser;
|
||||||
const isAirgappedInstance = isAirgapped();
|
const isAirgappedInstance = isAirgapped();
|
||||||
|
|
||||||
if (enableTelemetry) {
|
if (enableTelemetry) {
|
||||||
const promise = initializeAnalyticsAndTrackers();
|
// parallelize sentry and smart look initialization
|
||||||
|
|
||||||
if (promise instanceof Promise) {
|
yield fork(intializeSmartLook, currentUser);
|
||||||
const result: boolean = yield promise;
|
const initializeSentry = initializeAnalyticsAndTrackers();
|
||||||
|
|
||||||
if (result) {
|
if (initializeSentry instanceof Promise) {
|
||||||
|
const sentryInialized: boolean = yield initializeSentry;
|
||||||
|
|
||||||
|
if (sentryInialized) {
|
||||||
yield put(segmentInitSuccess());
|
yield put(segmentInitSuccess());
|
||||||
} else {
|
} else {
|
||||||
yield put(segmentInitUncertain());
|
yield put(segmentInitUncertain());
|
||||||
|
|
@ -209,10 +218,6 @@ export function* runUserSideEffectsSaga() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!currentUser.isAnonymous && currentUser.username !== ANONYMOUS_USERNAME) {
|
|
||||||
enableTelemetry && AnalyticsUtil.identifyUser(currentUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
const isFFFetched: boolean = yield select(getFeatureFlagsFetched);
|
const isFFFetched: boolean = yield select(getFeatureFlagsFetched);
|
||||||
|
|
||||||
if (!isFFFetched) {
|
if (!isFFFetched) {
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ export function IntercomConsent({
|
||||||
const instanceId = useSelector(getInstanceId);
|
const instanceId = useSelector(getInstanceId);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const sendUserDataToIntercom = () => {
|
const sendUserDataToIntercom = async () => {
|
||||||
const { email } = user || {};
|
const { email } = user || {};
|
||||||
|
|
||||||
updateIntercomProperties(instanceId, user);
|
updateIntercomProperties(instanceId, user);
|
||||||
|
|
@ -115,7 +115,7 @@ export function IntercomConsent({
|
||||||
showIntercomConsent(false);
|
showIntercomConsent(false);
|
||||||
|
|
||||||
if (user?.enableTelemetry) {
|
if (user?.enableTelemetry) {
|
||||||
AnalyticsUtil.identifyUser(user, true);
|
await AnalyticsUtil.identifyUser(user, true);
|
||||||
AnalyticsUtil.logEvent("SUPPORT_REQUEST_INITIATED", {
|
AnalyticsUtil.logEvent("SUPPORT_REQUEST_INITIATED", {
|
||||||
email,
|
email,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user