App icon indicating copy to clipboard operation
App copied to clipboard

Incorrect Environment Attribute Sent for Staging Sessions

Open m-natarajan opened this issue 11 months ago • 2 comments

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:

  1. Access a session where the user email matches the staging format: [email protected].
  2. Review the session details in FullStory.
  3. 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

View all open jobs on GitHub

m-natarajan avatar Dec 10 '24 23:12 m-natarajan

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.

melvin-bot[bot] avatar Dec 10 '24 23:12 melvin-bot[bot]

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

MelvinBot avatar Dec 10 '24 23:12 MelvinBot

Job added to Upwork: https://www.upwork.com/jobs/~021866822636661001653

melvin-bot[bot] avatar Dec 11 '24 12:12 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach (External)

melvin-bot[bot] avatar Dec 11 '24 12:12 melvin-bot[bot]

Are you able to reproduce this one @ZhenjaHorbach?

greg-schroeder avatar Dec 11 '24 12:12 greg-schroeder

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 😅

ZhenjaHorbach avatar Dec 11 '24 12:12 ZhenjaHorbach

Can't you just check the Onyx variable value we're passing? Do you actually need access to Fullstory?

anmurali avatar Dec 11 '24 18:12 anmurali

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; 
 } 

ZhenjaHorbach avatar Dec 11 '24 19:12 ZhenjaHorbach

That is correct. We should only record in staging if we're using the test email.

danieldoglas avatar Dec 11 '24 19:12 danieldoglas

What I think we need to figure out is how someone who is not a tester is having their session recorded in staging

danieldoglas avatar Dec 11 '24 19:12 danieldoglas

@greg-schroeder, @ZhenjaHorbach Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] avatar Dec 17 '24 09:12 melvin-bot[bot]

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

greg-schroeder avatar Dec 17 '24 13:12 greg-schroeder

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 avatar Dec 17 '24 16:12 ZhenjaHorbach

@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?

anmurali avatar Dec 20 '24 20:12 anmurali

@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

ZhenjaHorbach avatar Dec 20 '24 21:12 ZhenjaHorbach

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

ZhenjaHorbach avatar Dec 20 '24 22:12 ZhenjaHorbach

Yea me neither. I think we may need @danieldoglas to look into this further before we know the root cause.

anmurali avatar Dec 23 '24 19:12 anmurali

@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!

melvin-bot[bot] avatar Dec 24 '24 09:12 melvin-bot[bot]

@greg-schroeder, @ZhenjaHorbach Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Dec 24 '24 09:12 melvin-bot[bot]

@greg-schroeder, @ZhenjaHorbach Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] avatar Dec 26 '24 09:12 melvin-bot[bot]

Not overdue

ZhenjaHorbach avatar Dec 27 '24 09:12 ZhenjaHorbach

@greg-schroeder, @ZhenjaHorbach Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Dec 30 '24 09:12 melvin-bot[bot]

@greg-schroeder, @ZhenjaHorbach Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Dec 31 '24 09:12 melvin-bot[bot]

Not overdue

ZhenjaHorbach avatar Dec 31 '24 09:12 ZhenjaHorbach

@anmurali how many users are you seeing with this problem?

danieldoglas avatar Jan 02 '25 05:01 danieldoglas

@greg-schroeder, @ZhenjaHorbach Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Jan 03 '25 09:01 melvin-bot[bot]

@greg-schroeder, @ZhenjaHorbach Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Jan 06 '25 09:01 melvin-bot[bot]

Pending @danieldoglas review per https://github.com/Expensify/App/issues/53892#issuecomment-2560204940 I believe

greg-schroeder avatar Jan 06 '25 10:01 greg-schroeder

@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!

melvin-bot[bot] avatar Jan 07 '25 09:01 melvin-bot[bot]

@anmurali bump in the question above.

danieldoglas avatar Jan 07 '25 18:01 danieldoglas