App
App copied to clipboard
Incorrect Environment Attribute Sent for Staging Sessions
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: Reproducible in staging?: Needs Reproduction Reproducible in production?: Needs Reproduction If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @anmurali Slack conversation (hyperlinked to channel name): expensify_convert
Action Performed:
- Access a session where the user email matches the staging format: [email protected].
- Review the session details in FullStory.
- Observe the environment attribute.
Expected Result:
The environment attribute should accurately reflect the session's environment
Actual Result:
The environment attribute is incorrectly sent as production for users in the staging environment.
Full story session 1: https://app.fullstory.com/ui/o-1WN56P-na1/session/7395325973731847182:3405186692023031824!2964539090019794224
Full story session 2: https://app.fullstory.com/ui/o-1WN56P-na1/session/7395325973731847182:3405186692023031824!5533265545364867276
Segment in FS: https://app.fullstory.com/ui/o-1WN56P-na1/segments/h0mEJnfRoBYS/people/0?template=watch-sessions&completeSessions=false
( found 6600 in the last 30 days.)
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- [ ] Android: Standalone
- [ ] Android: HybridApp
- [ ] Android: mWeb Chrome
- [ ] iOS: Standalone
- [ ] iOS: HybridApp
- [ ] iOS: mWeb Safari
- [x] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
Triggered auto assignment to @greg-schroeder (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989
Job added to Upwork: https://www.upwork.com/jobs/~021866822636661001653
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach (External)
Are you able to reproduce this one @ZhenjaHorbach?
Are you able to reproduce this one @ZhenjaHorbach?
I'm not even sure I have access to https://app.fullstory.com to check the issue in more detail 😅
Can't you just check the Onyx variable value we're passing? Do you actually need access to Fullstory?
Hmmm I guess I know what the problem is Following this code the only valid ENV for FullStory is production https://github.com/Expensify/App/blob/c657371b3878b60a2ea538ce85060ad215fd03db/src/libs/Fullstory/index.ts#L60-L69 And when we try to use another ENV we will not be able to use the new value for environment As result we still have production
I believe @danieldoglas can confirm since he was working on the last PR related to FullStory !
Probably we should update a condition like: So that applause have access to FullStory using any ENV
if (!isTestEmail) {
return;
}
That is correct. We should only record in staging if we're using the test email.
What I think we need to figure out is how someone who is not a tester is having their session recorded in staging
@greg-schroeder, @ZhenjaHorbach Eep! 4 days overdue now. Issues have feelings too...
Discussion ongoing; I'm not sure the best way to do this:
What I think we need to figure out is how someone who is not a tester is having their session recorded in staging
Maybe we should give access to those applause accounts that have passed validation? To make the account valid we need to go through email verification
And update condition like (Additionally we can set specific env(only prod and staging for example))
const [user] = useOnyx(ONYXKEYS.USER);
const isUserValidated = user?.validated;
if (!isTestEmail || !isUserValidated ) {
return;
}
@ZhenjaHorbach I am not following why we would do that?
For context, Fullstory charges us per session recorded. The goal of using Fullstory is to understand user behavior. The only sessions in staging are testing, QA and other internal/ contract developers. There shouldn't be any real users using staging. So originally we were recording no staging sessions in Fullstory, cause why pay for what will give us zero insight into real user behavior? But a flip side of that is we cannot run regression tests on Fullstory integration code and it can and did break when we pushed out a major release. To solve for these conflicting priorities we designated ONE specific Applause email and one email alone for Fullstory testing. If an account signs up or signs in using that email + (something), then we record that session in Staging.
Does the design make sense for starters?
@ZhenjaHorbach I am not following why we would do that?
For context, Fullstory charges us per session recorded. The goal of using Fullstory is to understand user behavior. The only sessions in staging are testing, QA and other internal/ contract developers. There shouldn't be any real users using staging. So originally we were recording no staging sessions in Fullstory, cause why pay for what will give us zero insight into real user behavior? But a flip side of that is we cannot run regression tests on Fullstory integration code and it can and did break when we pushed out a major release. To solve for these conflicting priorities we designated ONE specific Applause email and one email alone for Fullstory testing. If an account signs up or signs in using that email + (something), then we record that session in Staging.
Does the design make sense for starters?
Oh yeah Thanks for the detailed explanation ! I must have been wrong I need to check this issue in more detail
What I think we need to figure out is how someone who is not a tester is having their session recorded in staging
@danieldoglas But I know the answer to that We have this logic for testEmail
https://github.com/Expensify/App/blob/c657371b3878b60a2ea538ce85060ad215fd03db/src/libs/Fullstory/index.ts#L60
And to check the domain we use endsWith This means that between @ and QA domain we can write anything we want and this will be a valid test domain
For example some valid emails : fullstory+anythinghere@aapplause.expensifail.com fullstory+anythinghere@helloapplause.expensifail.com
So this means that any user can create an account with a similar email And we will record the user's session
But I'm not quite sure how this relates to the main issue
Yea me neither. I think we may need @danieldoglas to look into this further before we know the root cause.
@greg-schroeder @ZhenjaHorbach this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@greg-schroeder, @ZhenjaHorbach Whoops! This issue is 2 days overdue. Let's get this updated quick!
@greg-schroeder, @ZhenjaHorbach Eep! 4 days overdue now. Issues have feelings too...
Not overdue
@greg-schroeder, @ZhenjaHorbach Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@greg-schroeder, @ZhenjaHorbach Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Not overdue
@anmurali how many users are you seeing with this problem?
@greg-schroeder, @ZhenjaHorbach Whoops! This issue is 2 days overdue. Let's get this updated quick!
@greg-schroeder, @ZhenjaHorbach Huh... This is 4 days overdue. Who can take care of this?
Pending @danieldoglas review per https://github.com/Expensify/App/issues/53892#issuecomment-2560204940 I believe
@danieldoglas @greg-schroeder @ZhenjaHorbach this issue is now 4 weeks old, please consider:
- Finding a contributor to fix the bug
- Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
- If you have any questions, don't hesitate to start a discussion in #expensify-open-source
Thanks!
@anmurali bump in the question above.