Skip to content
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

[NO QA] Check for expensify email before recording Fullstory #54966

Merged
merged 8 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/libs/Fullstory/index.native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ const FS = {
// after the init function since this function is also called on updates for
// UserMetadata onyx key.
Environment.getEnvironment().then((envName: string) => {
const isExpensifyEmail = value?.email?.endsWith(CONST.EMAIL.EXPENSIFY_EMAIL_DOMAIN);
Copy link
Member

Choose a reason for hiding this comment

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

Use Str.extractEmailDomain

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to use isExpensifyTeam function.

const isTestEmail = value.email !== undefined && value.email.startsWith('fullstory') && value.email.endsWith(CONST.EMAIL.QA_DOMAIN);
if (CONST.ENVIRONMENT.PRODUCTION !== envName && !isTestEmail) {
if ((CONST.ENVIRONMENT.PRODUCTION !== envName && !isTestEmail) || isExpensifyEmail) {
return;
}
FullStory.restart();
Expand Down
3 changes: 2 additions & 1 deletion src/libs/Fullstory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ const FS = {
}
try {
Environment.getEnvironment().then((envName: string) => {
const isExpensifyEmail = value?.email?.endsWith(CONST.EMAIL.EXPENSIFY_EMAIL_DOMAIN);
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to use isExpensifyTeam function.

const isTestEmail = value.email !== undefined && value.email.startsWith('fullstory') && value.email.endsWith(CONST.EMAIL.QA_DOMAIN);
if (CONST.ENVIRONMENT.PRODUCTION !== envName && !isTestEmail) {
if ((CONST.ENVIRONMENT.PRODUCTION !== envName && !isTestEmail) || isExpensifyEmail) {
return;
}
FS.onReady().then(() => {
Expand Down
Loading