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

Avatar is changed to old one until the page is refreshed #13223

Closed
kavimuru opened this issue Dec 1, 2022 · 44 comments
Closed

Avatar is changed to old one until the page is refreshed #13223

kavimuru opened this issue Dec 1, 2022 · 44 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Monthly KSv2 Needs Reproduction Reproducible steps needed Reviewing Has a PR in review

Comments

@kavimuru
Copy link

kavimuru commented Dec 1, 2022

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Change profile image
  2. Log out
  3. Login back after a while
  4. Observe the avatar

Expected Result:

Avatar image should be new one

Actual Result:

Old avatar appears and only after refresh the new image appears

Workaround:

unknown

Platform:

Where is this issue occurring?

  • Web

Version Number:
Reproducible in staging?: Needs reproduction
Reproducible in production?: Needs reproduction
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
Expensify/Expensify Issue URL:
Issue reported by: @cead22
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1669744450288299

View all open jobs on GitHub

@kavimuru kavimuru added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. and removed Daily KSv2 labels Dec 1, 2022
@melvin-bot
Copy link

melvin-bot bot commented Dec 1, 2022

Triggered auto assignment to @maddylewis (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Daily KSv2 label Dec 1, 2022
@maddylewis
Copy link
Contributor

maddylewis commented Dec 1, 2022

Managing a BUG issue

From  this  SO: https://stackoverflow.com/c/expensify/questions/14418

  • Confirm the "bug" is actually a  bug
  • Confirm the  bug is  not  a  duplicate  report of  an existing  GH (close  the  GH  and  add  any  relevant  details  to  the  original  GH ) 
  • The  bug  is  reproducible

If the bug is reproducible:

  • The GH is filled out completely  
  • The  GH  was  created  by  an  Expensify  employee  or  a  QA  tester
  • If  the  bug  is an OldDot issue,  you  should  decide  whether  it  is  widespread  enough  to  justify fixing or  it  is  better  to  wait  for  reunification. If  it’s  better  to  wait,  close  the  GH and  provide details
  • If there's  a  link  to  Slack, check the discussion and see why we decided to fix it or not
  • Decide if  the  GH should be resolved by an External contributor or an Internal engineer and add the appropriate label

@maddylewis
Copy link
Contributor

maddylewis commented Dec 1, 2022

Hm, I'm not able to reproduce this.

Action performed:

  1. Update profile picture
  2. Sign out
  3. Sign back in
  4. Profile picture shows as the updated photo

about 60 seconds of this video is of me trying to log into my account BUT it does show that the profile pics are the same at the beginning and the end:

2022-12-01_15-53-48.mp4

@maddylewis
Copy link
Contributor

followed up on the slack thread

@amyevans
Copy link
Contributor

amyevans commented Dec 2, 2022

I followed the test steps locally on web to test overnight and was unable to reproduce as well 😕

Is this web though? It looks more like desktop?

@maddylewis
Copy link
Contributor

logged in this morning and updated avatar photo is showing as expected / unable to reproduce:
image

@maddylewis
Copy link
Contributor

im on desktop. let me check web.

@maddylewis
Copy link
Contributor

i am also seeing the updated avatar on web:
image

@amyevans
Copy link
Contributor

amyevans commented Dec 2, 2022

Confirmed in the thread that those who can repro are on web. Going to assign myself as well to try to help repro and dig into the code a bit for some theories on failure points

@amyevans amyevans self-assigned this Dec 2, 2022
@melvin-bot melvin-bot bot added the Overdue label Dec 5, 2022
@maddylewis
Copy link
Contributor

im unable to repro. but amy is digging into this!

@melvin-bot melvin-bot bot removed the Overdue label Dec 5, 2022
@amyevans
Copy link
Contributor

amyevans commented Dec 6, 2022

Some notes from investigation:

Uploading an avatar calls UpdateUserAvatar, which calls UserAPI::updateUserAvatar(), which

  • calls self::uploadAvatar() , which uploads the file to S3 and returns links to both the thumbnail and original sized version
  • and calls PersonalDetailsAPI::update() to save the info
  • and pushes an Onyx update merging those values to personalDetails[$email] (which replaces the optimistically set blob values)

Refreshing the page calls OpenApp, and part of the response there includes personalDetails[$email]['avatar'], which is the avatar thumbnail.

Nothing jumped out to me as wrong when looking through the above.

I also looked at the logs from the times Carlos changed his avatar 11/9 and 12/5 and there were no errors.

@cead22, assuming this happens for you again tomorrow, could you take a screenshot of the personalDetails for your user in Onyx before and after you refresh? I'm curious of the values. Or alternatively you could ping me and we can investigate more live?

@cead22
Copy link
Contributor

cead22 commented Dec 6, 2022

This just happened to me a moment ago but I didn't capture it because I hadn't seen this comment. But this is happening to me every day, so I'll keep you posted

@cead22
Copy link
Contributor

cead22 commented Dec 6, 2022

HA!
image

Here are my personal details before and after and you can see they look very wrong 😬

{
  "login": "carlos@expensify.com",
  "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
  "displayName": "Carlos Alvarez",
  "pronouns": "",
  "timezone": {
    "automatic": "true",
    "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
    "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
    "displayName": "Carlos Alvarez",
    "firstName": "Carlos",
    "lastName": "Alvarez",
    "localCurrencyCode": "USD",
    "login": "carlos@expensify.com",
    "payPalMeAddress": "",
    "phoneNumber": "",
    "pronouns": "",
    "selected": "America/Mazatlan",
    "timezone": {
      "automatic": "true",
      "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
      "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
      "displayName": "Carlos Alvarez",
      "firstName": "Carlos",
      "lastName": "Alvarez",
      "localCurrencyCode": "USD",
      "login": "carlos@expensify.com",
      "payPalMeAddress": "",
      "phoneNumber": "",
      "pronouns": "",
      "selected": "America/Chihuahua",
      "timezone": {
        "automatic": "true",
        "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
        "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
        "displayName": "Carlos Alvarez",
        "firstName": "Carlos",
        "lastName": "Alvarez",
        "localCurrencyCode": "USD",
        "login": "carlos@expensify.com",
        "payPalMeAddress": "",
        "phoneNumber": "",
        "pronouns": "",
        "selected": "America/Chihuahua",
        "timezone": {
          "automatic": "true",
          "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
          "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
          "displayName": "Carlos Alvarez",
          "firstName": "Carlos",
          "lastName": "Alvarez",
          "localCurrencyCode": "USD",
          "login": "carlos@expensify.com",
          "payPalMeAddress": "",
          "phoneNumber": "",
          "pronouns": "",
          "selected": "America/Chihuahua",
          "timezone": {
            "automatic": "true",
            "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
            "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
            "displayName": "Carlos Alvarez",
            "firstName": "Carlos",
            "lastName": "Alvarez",
            "localCurrencyCode": "USD",
            "login": "carlos@expensify.com",
            "payPalMeAddress": "",
            "phoneNumber": "",
            "pronouns": "",
            "selected": "America/Chihuahua",
            "timezone": {
              "automatic": "true",
              "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
              "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
              "displayName": "Carlos Alvarez",
              "firstName": "Carlos",
              "lastName": "Alvarez",
              "localCurrencyCode": "USD",
              "login": "carlos@expensify.com",
              "payPalMeAddress": "",
              "phoneNumber": "",
              "pronouns": "",
              "selected": "America/Chihuahua",
              "timezone": {
                "automatic": "true",
                "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                "displayName": "Carlos Alvarez",
                "firstName": "Carlos",
                "lastName": "Alvarez",
                "localCurrencyCode": "USD",
                "login": "carlos@expensify.com",
                "payPalMeAddress": "",
                "phoneNumber": "",
                "pronouns": "",
                "selected": "America/Chihuahua",
                "timezone": {
                  "automatic": "true",
                  "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                  "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                  "displayName": "Carlos Alvarez",
                  "firstName": "Carlos",
                  "lastName": "Alvarez",
                  "localCurrencyCode": "USD",
                  "login": "carlos@expensify.com",
                  "payPalMeAddress": "",
                  "phoneNumber": "",
                  "pronouns": "",
                  "selected": "America/Chihuahua",
                  "timezone": {
                    "automatic": "true",
                    "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                    "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                    "displayName": "Carlos Alvarez",
                    "firstName": "Carlos",
                    "lastName": "Alvarez",
                    "localCurrencyCode": "USD",
                    "login": "carlos@expensify.com",
                    "payPalMeAddress": "",
                    "phoneNumber": "",
                    "pronouns": "",
                    "selected": "America/Chihuahua",
                    "timezone": {
                      "automatic": "true",
                      "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                      "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                      "displayName": "Carlos Alvarez",
                      "firstName": "Carlos",
                      "lastName": "Alvarez",
                      "localCurrencyCode": "USD",
                      "login": "carlos@expensify.com",
                      "payPalMeAddress": "",
                      "phoneNumber": "",
                      "pronouns": "",
                      "selected": "America/Chihuahua",
                      "timezone": {
                        "automatic": "true",
                        "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                        "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                        "displayName": "Carlos Alvarez",
                        "firstName": "Carlos",
                        "lastName": "Alvarez",
                        "localCurrencyCode": "USD",
                        "login": "carlos@expensify.com",
                        "payPalMeAddress": "",
                        "phoneNumber": "",
                        "pronouns": "",
                        "selected": "America/Chihuahua",
                        "timezone": {
                          "automatic": "true",
                          "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                          "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                          "displayName": "Carlos Alvarez",
                          "firstName": "Carlos",
                          "lastName": "Alvarez",
                          "localCurrencyCode": "USD",
                          "login": "carlos@expensify.com",
                          "payPalMeAddress": "",
                          "phoneNumber": "",
                          "pronouns": "",
                          "selected": "America/Chihuahua",
                          "timezone": {
                            "automatic": "true",
                            "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                            "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                            "displayName": "Carlos Alvarez",
                            "firstName": "Carlos",
                            "lastName": "Alvarez",
                            "localCurrencyCode": "USD",
                            "login": "carlos@expensify.com",
                            "payPalMeAddress": "",
                            "phoneNumber": "",
                            "pronouns": "",
                            "selected": "America/Chihuahua",
                            "timezone": {
                              "automatic": "true",
                              "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                              "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                              "displayName": "Carlos Alvarez",
                              "firstName": "Carlos",
                              "lastName": "Alvarez",
                              "localCurrencyCode": "USD",
                              "login": "carlos@expensify.com",
                              "payPalMeAddress": "",
                              "phoneNumber": "",
                              "pronouns": "",
                              "selected": "America/Chihuahua",
                              "timezone": {
                                "automatic": "true",
                                "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                "displayName": "Carlos Alvarez",
                                "firstName": "Carlos",
                                "lastName": "Alvarez",
                                "localCurrencyCode": "USD",
                                "login": "carlos@expensify.com",
                                "payPalMeAddress": "",
                                "phoneNumber": "",
                                "pronouns": "",
                                "selected": "America/Chihuahua",
                                "timezone": {
                                  "automatic": "true",
                                  "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                  "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                  "displayName": "Carlos Alvarez",
                                  "firstName": "Carlos",
                                  "lastName": "Alvarez",
                                  "localCurrencyCode": "USD",
                                  "login": "carlos@expensify.com",
                                  "payPalMeAddress": "",
                                  "phoneNumber": "",
                                  "pronouns": "",
                                  "selected": "America/Chihuahua",
                                  "timezone": {
                                    "automatic": "true",
                                    "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                    "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                    "displayName": "Carlos Alvarez",
                                    "firstName": "Carlos",
                                    "lastName": "Alvarez",
                                    "localCurrencyCode": "USD",
                                    "login": "carlos@expensify.com",
                                    "payPalMeAddress": "",
                                    "phoneNumber": "",
                                    "pronouns": "",
                                    "selected": "America/Chihuahua",
                                    "timezone": {
                                      "automatic": "true",
                                      "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                      "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                      "displayName": "Carlos Alvarez",
                                      "firstName": "Carlos",
                                      "lastName": "Alvarez",
                                      "localCurrencyCode": "USD",
                                      "login": "carlos@expensify.com",
                                      "payPalMeAddress": "",
                                      "phoneNumber": "",
                                      "pronouns": "",
                                      "selected": "America/Chihuahua",
                                      "timezone": {
                                        "automatic": "true",
                                        "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                        "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                        "displayName": "Carlos Alvarez",
                                        "firstName": "Carlos",
                                        "lastName": "Alvarez",
                                        "localCurrencyCode": "USD",
                                        "login": "carlos@expensify.com",
                                        "payPalMeAddress": "",
                                        "phoneNumber": "",
                                        "pronouns": "",
                                        "selected": "America/Chihuahua",
                                        "timezone": {
                                          "automatic": "true",
                                          "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                          "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                          "displayName": "Carlos Alvarez",
                                          "firstName": "Carlos",
                                          "lastName": "Alvarez",
                                          "localCurrencyCode": "USD",
                                          "login": "carlos@expensify.com",
                                          "payPalMeAddress": "",
                                          "phoneNumber": "",
                                          "pronouns": "",
                                          "selected": "America/Chihuahua",
                                          "timezone": {
                                            "automatic": "true",
                                            "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                            "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                            "displayName": "Carlos Alvarez",
                                            "firstName": "Carlos",
                                            "lastName": "Alvarez",
                                            "localCurrencyCode": "USD",
                                            "login": "carlos@expensify.com",
                                            "payPalMeAddress": "",
                                            "phoneNumber": "",
                                            "pronouns": "",
                                            "selected": "America/Chihuahua",
                                            "timezone": {
                                              "automatic": "true",
                                              "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                              "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                              "displayName": "Carlos Alvarez",
                                              "firstName": "Carlos",
                                              "lastName": "Alvarez",
                                              "localCurrencyCode": "USD",
                                              "login": "carlos@expensify.com",
                                              "payPalMeAddress": "",
                                              "phoneNumber": "",
                                              "pronouns": "",
                                              "selected": "America/Chihuahua",
                                              "timezone": {
                                                "automatic": "true",
                                                "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                                "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                                "displayName": "Carlos Alvarez",
                                                "firstName": "Carlos",
                                                "lastName": "Alvarez",
                                                "localCurrencyCode": "USD",
                                                "login": "carlos@expensify.com",
                                                "payPalMeAddress": "",
                                                "phoneNumber": "",
                                                "pronouns": "",
                                                "selected": "America/Chihuahua",
                                                "timezone": {
                                                  "automatic": "true",
                                                  "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                                  "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                                  "displayName": "Carlos Alvarez",
                                                  "firstName": "Carlos",
                                                  "lastName": "Alvarez",
                                                  "localCurrencyCode": "USD",
                                                  "login": "carlos@expensify.com",
                                                  "payPalMeAddress": "",
                                                  "phoneNumber": "",
                                                  "pronouns": "",
                                                  "selected": "America/Chihuahua",
                                                  "timezone": {
                                                    "automatic": "true",
                                                    "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                                    "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                                    "displayName": "Carlos Alvarez",
                                                    "firstName": "Carlos",
                                                    "lastName": "Alvarez",
                                                    "localCurrencyCode": "USD",
                                                    "login": "carlos@expensify.com",
                                                    "payPalMeAddress": "",
                                                    "phoneNumber": "",
                                                    "pronouns": "",
                                                    "selected": "America/Chihuahua"
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "firstName": "Carlos",
  "lastName": "Alvarez",
  "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
  "payPalMeAddress": "",
  "phoneNumber": "",
  "validated": true,
  "localCurrencyCode": "USD",
  "automatic": "true",
  "selected": "America/Mazatlan",
  "avatarThumbnail": "https://d1wpcgnaa73g0y.cloudfront.net/f902de57dcf99b90b0da9a1169ea2870fae050d2_128.png",
  "errorFields": {
    "avatar": null
  },
  "pendingFields": {
    "avatar": null
  },
  "s3url": "https://d1wpcgnaa73g0y.cloudfront.net/f902de57dcf99b90b0da9a1169ea2870fae050d2.png"
}
<pre>
{
  "login": "carlos@expensify.com",
  "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/f902de57dcf99b90b0da9a1169ea2870fae050d2.png",
  "displayName": "Carlos Alvarez",
  "pronouns": "",
  "timezone": {
    "automatic": "true",
    "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
    "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
    "displayName": "Carlos Alvarez",
    "firstName": "Carlos",
    "lastName": "Alvarez",
    "localCurrencyCode": "USD",
    "login": "carlos@expensify.com",
    "payPalMeAddress": "",
    "phoneNumber": "",
    "pronouns": "",
    "selected": "America/Mazatlan",
    "timezone": {
      "automatic": "true",
      "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
      "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
      "displayName": "Carlos Alvarez",
      "firstName": "Carlos",
      "lastName": "Alvarez",
      "localCurrencyCode": "USD",
      "login": "carlos@expensify.com",
      "payPalMeAddress": "",
      "phoneNumber": "",
      "pronouns": "",
      "selected": "America/Chihuahua",
      "timezone": {
        "automatic": "true",
        "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
        "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
        "displayName": "Carlos Alvarez",
        "firstName": "Carlos",
        "lastName": "Alvarez",
        "localCurrencyCode": "USD",
        "login": "carlos@expensify.com",
        "payPalMeAddress": "",
        "phoneNumber": "",
        "pronouns": "",
        "selected": "America/Chihuahua",
        "timezone": {
          "automatic": "true",
          "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
          "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
          "displayName": "Carlos Alvarez",
          "firstName": "Carlos",
          "lastName": "Alvarez",
          "localCurrencyCode": "USD",
          "login": "carlos@expensify.com",
          "payPalMeAddress": "",
          "phoneNumber": "",
          "pronouns": "",
          "selected": "America/Chihuahua",
          "timezone": {
            "automatic": "true",
            "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
            "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
            "displayName": "Carlos Alvarez",
            "firstName": "Carlos",
            "lastName": "Alvarez",
            "localCurrencyCode": "USD",
            "login": "carlos@expensify.com",
            "payPalMeAddress": "",
            "phoneNumber": "",
            "pronouns": "",
            "selected": "America/Chihuahua",
            "timezone": {
              "automatic": "true",
              "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
              "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
              "displayName": "Carlos Alvarez",
              "firstName": "Carlos",
              "lastName": "Alvarez",
              "localCurrencyCode": "USD",
              "login": "carlos@expensify.com",
              "payPalMeAddress": "",
              "phoneNumber": "",
              "pronouns": "",
              "selected": "America/Chihuahua",
              "timezone": {
                "automatic": "true",
                "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                "displayName": "Carlos Alvarez",
                "firstName": "Carlos",
                "lastName": "Alvarez",
                "localCurrencyCode": "USD",
                "login": "carlos@expensify.com",
                "payPalMeAddress": "",
                "phoneNumber": "",
                "pronouns": "",
                "selected": "America/Chihuahua",
                "timezone": {
                  "automatic": "true",
                  "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                  "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                  "displayName": "Carlos Alvarez",
                  "firstName": "Carlos",
                  "lastName": "Alvarez",
                  "localCurrencyCode": "USD",
                  "login": "carlos@expensify.com",
                  "payPalMeAddress": "",
                  "phoneNumber": "",
                  "pronouns": "",
                  "selected": "America/Chihuahua",
                  "timezone": {
                    "automatic": "true",
                    "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                    "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                    "displayName": "Carlos Alvarez",
                    "firstName": "Carlos",
                    "lastName": "Alvarez",
                    "localCurrencyCode": "USD",
                    "login": "carlos@expensify.com",
                    "payPalMeAddress": "",
                    "phoneNumber": "",
                    "pronouns": "",
                    "selected": "America/Chihuahua",
                    "timezone": {
                      "automatic": "true",
                      "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                      "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                      "displayName": "Carlos Alvarez",
                      "firstName": "Carlos",
                      "lastName": "Alvarez",
                      "localCurrencyCode": "USD",
                      "login": "carlos@expensify.com",
                      "payPalMeAddress": "",
                      "phoneNumber": "",
                      "pronouns": "",
                      "selected": "America/Chihuahua",
                      "timezone": {
                        "automatic": "true",
                        "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                        "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                        "displayName": "Carlos Alvarez",
                        "firstName": "Carlos",
                        "lastName": "Alvarez",
                        "localCurrencyCode": "USD",
                        "login": "carlos@expensify.com",
                        "payPalMeAddress": "",
                        "phoneNumber": "",
                        "pronouns": "",
                        "selected": "America/Chihuahua",
                        "timezone": {
                          "automatic": "true",
                          "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                          "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                          "displayName": "Carlos Alvarez",
                          "firstName": "Carlos",
                          "lastName": "Alvarez",
                          "localCurrencyCode": "USD",
                          "login": "carlos@expensify.com",
                          "payPalMeAddress": "",
                          "phoneNumber": "",
                          "pronouns": "",
                          "selected": "America/Chihuahua",
                          "timezone": {
                            "automatic": "true",
                            "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                            "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                            "displayName": "Carlos Alvarez",
                            "firstName": "Carlos",
                            "lastName": "Alvarez",
                            "localCurrencyCode": "USD",
                            "login": "carlos@expensify.com",
                            "payPalMeAddress": "",
                            "phoneNumber": "",
                            "pronouns": "",
                            "selected": "America/Chihuahua",
                            "timezone": {
                              "automatic": "true",
                              "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                              "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                              "displayName": "Carlos Alvarez",
                              "firstName": "Carlos",
                              "lastName": "Alvarez",
                              "localCurrencyCode": "USD",
                              "login": "carlos@expensify.com",
                              "payPalMeAddress": "",
                              "phoneNumber": "",
                              "pronouns": "",
                              "selected": "America/Chihuahua",
                              "timezone": {
                                "automatic": "true",
                                "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                "displayName": "Carlos Alvarez",
                                "firstName": "Carlos",
                                "lastName": "Alvarez",
                                "localCurrencyCode": "USD",
                                "login": "carlos@expensify.com",
                                "payPalMeAddress": "",
                                "phoneNumber": "",
                                "pronouns": "",
                                "selected": "America/Chihuahua",
                                "timezone": {
                                  "automatic": "true",
                                  "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                  "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                  "displayName": "Carlos Alvarez",
                                  "firstName": "Carlos",
                                  "lastName": "Alvarez",
                                  "localCurrencyCode": "USD",
                                  "login": "carlos@expensify.com",
                                  "payPalMeAddress": "",
                                  "phoneNumber": "",
                                  "pronouns": "",
                                  "selected": "America/Chihuahua",
                                  "timezone": {
                                    "automatic": "true",
                                    "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                    "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                    "displayName": "Carlos Alvarez",
                                    "firstName": "Carlos",
                                    "lastName": "Alvarez",
                                    "localCurrencyCode": "USD",
                                    "login": "carlos@expensify.com",
                                    "payPalMeAddress": "",
                                    "phoneNumber": "",
                                    "pronouns": "",
                                    "selected": "America/Chihuahua",
                                    "timezone": {
                                      "automatic": "true",
                                      "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                      "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                      "displayName": "Carlos Alvarez",
                                      "firstName": "Carlos",
                                      "lastName": "Alvarez",
                                      "localCurrencyCode": "USD",
                                      "login": "carlos@expensify.com",
                                      "payPalMeAddress": "",
                                      "phoneNumber": "",
                                      "pronouns": "",
                                      "selected": "America/Chihuahua",
                                      "timezone": {
                                        "automatic": "true",
                                        "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                        "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                        "displayName": "Carlos Alvarez",
                                        "firstName": "Carlos",
                                        "lastName": "Alvarez",
                                        "localCurrencyCode": "USD",
                                        "login": "carlos@expensify.com",
                                        "payPalMeAddress": "",
                                        "phoneNumber": "",
                                        "pronouns": "",
                                        "selected": "America/Chihuahua",
                                        "timezone": {
                                          "automatic": "true",
                                          "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                          "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                          "displayName": "Carlos Alvarez",
                                          "firstName": "Carlos",
                                          "lastName": "Alvarez",
                                          "localCurrencyCode": "USD",
                                          "login": "carlos@expensify.com",
                                          "payPalMeAddress": "",
                                          "phoneNumber": "",
                                          "pronouns": "",
                                          "selected": "America/Chihuahua",
                                          "timezone": {
                                            "automatic": "true",
                                            "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                            "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                            "displayName": "Carlos Alvarez",
                                            "firstName": "Carlos",
                                            "lastName": "Alvarez",
                                            "localCurrencyCode": "USD",
                                            "login": "carlos@expensify.com",
                                            "payPalMeAddress": "",
                                            "phoneNumber": "",
                                            "pronouns": "",
                                            "selected": "America/Chihuahua",
                                            "timezone": {
                                              "automatic": "true",
                                              "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                              "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                              "displayName": "Carlos Alvarez",
                                              "firstName": "Carlos",
                                              "lastName": "Alvarez",
                                              "localCurrencyCode": "USD",
                                              "login": "carlos@expensify.com",
                                              "payPalMeAddress": "",
                                              "phoneNumber": "",
                                              "pronouns": "",
                                              "selected": "America/Chihuahua",
                                              "timezone": {
                                                "automatic": "true",
                                                "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                                "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                                "displayName": "Carlos Alvarez",
                                                "firstName": "Carlos",
                                                "lastName": "Alvarez",
                                                "localCurrencyCode": "USD",
                                                "login": "carlos@expensify.com",
                                                "payPalMeAddress": "",
                                                "phoneNumber": "",
                                                "pronouns": "",
                                                "selected": "America/Chihuahua",
                                                "timezone": {
                                                  "automatic": "true",
                                                  "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                                  "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                                  "displayName": "Carlos Alvarez",
                                                  "firstName": "Carlos",
                                                  "lastName": "Alvarez",
                                                  "localCurrencyCode": "USD",
                                                  "login": "carlos@expensify.com",
                                                  "payPalMeAddress": "",
                                                  "phoneNumber": "",
                                                  "pronouns": "",
                                                  "selected": "America/Chihuahua",
                                                  "timezone": {
                                                    "automatic": "true",
                                                    "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg",
                                                    "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
                                                    "displayName": "Carlos Alvarez",
                                                    "firstName": "Carlos",
                                                    "lastName": "Alvarez",
                                                    "localCurrencyCode": "USD",
                                                    "login": "carlos@expensify.com",
                                                    "payPalMeAddress": "",
                                                    "phoneNumber": "",
                                                    "pronouns": "",
                                                    "selected": "America/Chihuahua"
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "firstName": "Carlos",
  "lastName": "Alvarez",
  "avatarHighResolution": "https://d1wpcgnaa73g0y.cloudfront.net/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg",
  "payPalMeAddress": "",
  "phoneNumber": "",
  "validated": true,
  "localCurrencyCode": "MXN",
  "automatic": "true",
  "selected": "America/Mazatlan",
  "avatarThumbnail": "https://d1wpcgnaa73g0y.cloudfront.net/f902de57dcf99b90b0da9a1169ea2870fae050d2_128.png",
  "errorFields": {
    "avatar": null
  },
  "pendingFields": {
    "avatar": null
  },
  "s3url": "https://d1wpcgnaa73g0y.cloudfront.net/f902de57dcf99b90b0da9a1169ea2870fae050d2.png"
}

The difference between the two is below, so it looks like my avatar and currency are changing

  "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/488b8e       |         "avatar": "https://d1wpcgnaa73g0y.cloudfront.net/f902de
  "localCurrencyCode": "USD",					|         "localCurrencyCode": "MXN",
}
\ No newline at end of file
								|       }

I got them using this snipper

details = {}
function getAccount() {
    let conn = indexedDB.open('OnyxDB',2);
    let db;
    conn.onsuccess = (e) => {
        db = e.target.result;
        let t = db.transaction('keyvaluepairs', 'readonly')
        let nvps = t.objectStore('keyvaluepairs');
        let get = nvps.get('personalDetails');
        get.onsuccess = (e) => details = (e.target.result['carlos@expensify.com']);
        t.onsuccess = (r) => console.log('error');
        t.onerror = (r) => console.log(t.result.text);
    }
}
getAccount()
copy(JSON.stringify( details))

@amyevans
Copy link
Contributor

amyevans commented Dec 7, 2022

Interesting, yes, they look very wrong, in particular the recursion happening in timezone 😬 . I know that doesn't exactly connect the dots between the avatar and localCurrencyCode fields reverting, but it feels related/problematic...

Here's an example more along the lines of what it should look like:

{
    "login": "a@b.com",
    "avatar": "https://d2g02b6ed2w9fz.cloudfront.net/05e4470bf5da65f7a26a66d64d46599da13abf5e_128.jpeg",
    "displayName": "a@b.com",
    "pronouns": "",
    "timezone": {
        "automatic": true,
        "selected": "America/New_York"
    },
    "firstName": "",
    "lastName": "",
    "payPalMeAddress": "",
    "phoneNumber": "",
    "validated": true,
    "localCurrencyCode": "USD",
    "avatarThumbnail": "https://d2g02b6ed2w9fz.cloudfront.net/05e4470bf5da65f7a26a66d64d46599da13abf5e_128.jpeg",
    "errorFields": {
        "avatar": null
    },
    "pendingFields": {
        "avatar": null
    },
    "s3url": "https://d2g02b6ed2w9fz.cloudfront.net/05e4470bf5da65f7a26a66d64d46599da13abf5e.jpeg"
}

I'll keep exploring how this might be happening. Though perhaps we should just try a manual query to fix the NVP and see if that helps?

@aldo-expensify
Copy link
Contributor

About the recursive timezone, this happened in the past. In case it is of any use:

#10043
https://github.com/Expensify/Expensify/issues/219656

@cead22
Copy link
Contributor

cead22 commented Dec 8, 2022

Let me know if I can get any other info
image

@cead22
Copy link
Contributor

cead22 commented Dec 8, 2022

I updated my NVP to remove the recursive timezone. I'll report back if this solves the issue or if it happens again

before after
image image

@amyevans
Copy link
Contributor

amyevans commented Dec 8, 2022

Okay cool, thanks @cead22! Sorry I haven't spent much extra time digging in here the past 2 days but I think updating the NVP is low-hanging fruit to see if it helps (or at least remove the variable). And thanks @aldo-expensify for the additional context!

@cead22
Copy link
Contributor

cead22 commented Dec 8, 2022

I signed out and in, and the timezone in new dot still has timezones in it. I updated my timezone manually, and then clicked the box to update it automatically, and that didn't fix the issue
image

@amyevans
Copy link
Contributor

amyevans commented Dec 9, 2022

@cead22 when you say

I updated my NVP to remove the recursive timezone

do you mean in the database or in Onyx?

If you meant only in Onyx, can you buddy check and run the queries below (since the DB is where the values are coming from on log in/page refresh):

SELECT value FROM nameValuePairs WHERE name='timeZone' AND accountID IN (SELECT accountID FROM accounts WHERE email="carlos@expensify.com");
DELETE FROM nameValuePairs WHERE name='timeZone' AND accountID IN (SELECT accountID FROM accounts WHERE email="carlos@expensify.com");

@melvin-bot melvin-bot bot added the Overdue label Dec 12, 2022
@amyevans
Copy link
Contributor

@cead22 Okay cool, let me know how things go today then, whether it's still a reproducible issue for you or not!

@melvin-bot
Copy link

melvin-bot bot commented Dec 12, 2022

@amyevans, @maddylewis Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@amyevans
Copy link
Contributor

Recently updated, Melv

@melvin-bot melvin-bot bot removed the Overdue label Dec 12, 2022
@cead22
Copy link
Contributor

cead22 commented Dec 12, 2022

This is still happening for me today even though I signed out and in after deleting the NVP
image
image

@cead22
Copy link
Contributor

cead22 commented Dec 13, 2022

I checkd on old dot and the NVP is still set somehow
image

So I deleted
image

And then refreshed old dot, and it's set to what looks like a default value or a value set based on my location
image

I signout and back in on new dot, and it looks like the same value that looks like that same value is showing now
image

Maybe this will fix it

@cead22
Copy link
Contributor

cead22 commented Dec 13, 2022

That didn't fix it
image

@aldo-expensify
Copy link
Contributor

Do we have clear steps on how to replicate the timezone stuff? is it happening in production? staging? both?

@amyevans
Copy link
Contributor

Additional request for you @cead22 if possible: could you take a screen recording with the Network tab filtered to show only api?command, and the console set to All levels of logging, and then redo your actions of reseting the NVP and refreshing the page (or whatever steps exactly you're taking to reproduce this issue)?

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Dec 13, 2022

I found these logs:

778ac6ce8eebe942-DFW | virt1.sjc | 2022-12-13 01:02:50 685 | carlos@expensify.com | Bedrock\Client - Starting a request ~~ command: 'SetNameValuePair' clusterName: 'auth' headers: '[authToken: '<REDACTED>' name: 'timeZone' value: '{"automatic":true,"selected":"America\/Mazatlan"}' logParam: 'carlos@expensify.com' commitCount: '17952673931' requestID: '778ac6ce8eebe942-DFW' lastIP: '187.223.175.39' writeConsistency: 'ASYNC' priority: '500' timeout: '290000']'
-- | -- | -- | -- | --
778ac6ce8eebe942-DFW | virt1.sjc | 2022-12-13 01:02:50 686 | carlos@expensify.com | Auth - AuthRequest #2 ~~ command: 'SetNameValuePair' jsonCode: '200' size: '901' duration: '1ms' host: 'db2.sjc' name: 'timeZone'
778ac6ce8eebe942-DFW | virt1.sjc | 2022-12-13 01:02:50 688 | carlos@expensify.com | Profile ~~ {"total":11,"cmd":"SetNameValuePair","name":"timeZone","jsonCode":200,"output":{"size":124,"gzip":1,"ratio":110},"gzip":124,"PHP":{"total":8,"%":72,"boot":3,"proc":5,"pack":0,"mem":10},"Auth":{"time":4,"%":36,"count":3,"requests":{"Get rVL='account'":1,"SetNameValuePair":1,"Get rVL=''":1},"size":3771}}
778b33daca08ea88-DFW | virt1.sjc | 2022-12-13 02:17:17 339 | carlos@expensify.com | Bedrock\Client - Starting a request ~~ command: 'SetNameValuePair' clusterName: 'auth' headers: '[authToken: '<REDACTED>' name: 'timeZone' value: '{"automatic":true,"selected":"America\/Mazatlan","avatar":"https:\/\/d1wpcgnaa73g0y.cloudfront.net\/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg","avatarHighResolution":"https:\/\/d1wpcgnaa73g0y.cloudfront.net\/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg","displayName":"Carlos Alvarez","firstName":"Carlos","lastName":"Alvarez","localCurrencyCode":"USD","login":"carlos@expensify.com","payPalMeAddress":"","phoneNumber":"","pronouns":"","timezone":{"automatic":"true","avatar":"https:\/\/d1wpcgnaa73g0y.cloudfront.net\/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg","avatarHighResolution":"https:\/\/d1wpcgnaa73g0y.cloudfront.net\/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg","displayName":"Carlos Alvarez","firstName":"Carlos","lastName":"Alvarez","localCurrencyCode":"USD","login":"carlos@expensify.com","payPalMeAddress":"","phoneNumber":"","pronouns":"","selected":"America\/Chihuahua","timezone":{"automatic":"true","avatar":"https:\/\/d1wpcgnaa73g0y.cloudfront.net\/488b8ebecfd7c916da4161cafbc8a6b943e20cf0_128.jpeg","avatarHighResolution":"https:\/\/d1wpcgnaa73g0y.cloudfront.net\/488b8ebecfd7c916da4161cafbc8a6b943e20cf0.jpeg","displayName":"Carlos Alvarez","firstName":"Carlos","lastName":"Alvarez","localCurre

The first request 778ac6ce8eebe942-DFW sets the timeZone nvp to {"automatic":true,"selected":"America\/Mazatlan"} which is fine
The second request 778b33daca08ea88-DFW is AddComment with a timezone, and here the timezone is borked

Looking at AddComment here

optimisticData.push({
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.PERSONAL_DETAILS,
value: {[currentUserEmail]: timezone},
});

I'm pretty sure it is wrong, it should be:

-            value: {[currentUserEmail]: timezone},
+            value: {[currentUserEmail]: {timezone}},

I'm not sure that this is the root cause, but it looks like a bug because then the timezone stuff gets merged with the personal details:

image

@cead22
Copy link
Contributor

cead22 commented Dec 13, 2022

I did it, and personalDetails doesn't show a "recursive" timezone in new dot https://recordit.co/PurQPh5hM3

@amyevans
Copy link
Contributor

Nice find @aldo-expensify! Want to PR a fix or want me to? Agreed that it may not be the root cause, but is definitely a bug nonetheless. And thanks for the recording @cead22!

@amyevans
Copy link
Contributor

Looking at the logs of API commands run on his account between the "good" request (778ac6ce8eebe942-DFW) and "bad" request (778b33daca08ea88-DFW), I see he's getting into this flow:

// If the current timezone is different than the user's timezone, and their timezone is set to automatic
// then update their timezone.
if (_.isObject(timezone) && timezone.automatic && timezone.selected !== currentTimezone) {
timezone.selected = currentTimezone;
PersonalDetails.setPersonalDetails({timezone});
}

Which triggers a call to the deprecated API command PersonalDetails_Update. Looking at the Tracking issue for that command refactor and the associated App PR, it seems like removing it from AuthScreens.js got overlooked, but @Beamanator maybe you can just confirm that or provide any additional context?

Again, not sure that's necessarily related to the bug here, but just pointing out what I'm uncovering along the way.

@melvin-bot

This comment was marked as off-topic.

@aldo-expensify
Copy link
Contributor

Nice find @aldo-expensify! Want to PR a fix or want me to?

I can PR it

@amyevans
Copy link
Contributor

Cool, tag me and I'll review

@amyevans
Copy link
Contributor

Requested to have my IP address whitelisted. Once that's set I'm going to try to reproduce against the production API with a high traffic account since I think that may be a factor here as well.

@melvin-bot
Copy link

melvin-bot bot commented Dec 21, 2022

@amyevans, @maddylewis Whoops! This issue is 2 days overdue. Let's get this updated quick!

@maddylewis
Copy link
Contributor

we'll get back to this after the holidays!

@maddylewis maddylewis added Weekly KSv2 and removed Daily KSv2 labels Dec 22, 2022
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Jan 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jan 16, 2023

This issue has not been updated in over 15 days. @amyevans, @maddylewis eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@maddylewis
Copy link
Contributor

@amyevans were you able to reproduce this? i still am not getting the same result as carlos.

@amyevans
Copy link
Contributor

amyevans commented Jan 17, 2023

No, I haven't been able to reproduce. @cead22 are you still experiencing the issue? @Beamanator any thoughts/what's the latest on Avatar refactors (I think I maybe saw you were working on their refactor pretty recently)?

@cead22
Copy link
Contributor

cead22 commented Jan 17, 2023

I haven't had this happen in a few weeks actually 🎉 let's close it until we see it again

@cead22 cead22 closed this as completed Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Monthly KSv2 Needs Reproduction Reproducible steps needed Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

5 participants