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

HybridApp blocked after signing into new experience account #49979

Closed
Julesssss opened this issue Oct 1, 2024 · 34 comments
Closed

HybridApp blocked after signing into new experience account #49979

Julesssss opened this issue Oct 1, 2024 · 34 comments
Assignees
Labels
Daily KSv2 Engineering Internal Requires API changes or must be handled by Expensify staff

Comments

@Julesssss
Copy link
Contributor

Julesssss commented Oct 1, 2024

Problem

HybridApp iOS and Android apps are bricked by this screen after authenticating with a user set to new experience.

  • Clear app data, or uninstall and reinstall the HybridApp
  • Authenticate as a user (user must be set to the new experience)
    • You can force this by updating your tryNewDot NVP

Expected Result:

  • You should land in the app with your LHN data displayed
  • Your user avatar should be displayed in the bottom nav

Actual Result:

  • You are temporarily stuck at a blank page
  • You then land in the app without any data
  • The Woohoo animation is displayed and no chats are visible

Discussed here in Slack.

IMG_A8B2918CE269-1 Screenshot_20240930-174637-2024-10-01 10_08_08 918

Solution

Work back through versions, seeking regression.

@Julesssss Julesssss added Engineering Daily KSv2 Internal Requires API changes or must be handled by Expensify staff labels Oct 1, 2024
@Julesssss Julesssss changed the title [HybridApp] App blocked after signing into new experience account HybridApp blocked after signing into new experience account Oct 1, 2024
@Julesssss
Copy link
Contributor Author

Julesssss commented Oct 1, 2024

Still seeing the issue this morning. It seems that after about 60 seconds I do land inside the app, but no data has loaded and I see the 'Woohoo! All caught up' animation 😕

Initial triage:

  • Android 9.0.41.2 already authenticated -- land at empty LHN
  • iOS 9.0.41.2 fresh install -- see blank page for a while, then land at blank page
  • iOS 9.0.41.2 fresh install -- land at empty LHN

Does app load correctly:

  • 9.0.41.2 ❌
  • 9.0.42.0 ❌
  • 9.0.41.10 ✅
  • 9.0.41.5 ✅
  • 9.0.40.6 ✅

Bug was introduce with this App release: #49960

@Julesssss
Copy link
Contributor Author

As we need to align NewDot and HybridApp releases, I think this is important enough to treat as a NewDot blocker given that HybridApp is live in the store, and this issue blocks us from shipping regular fixes to our production app. This will ensure:

  • We locate the regression while NewDot PRs are still fresh in people's minds
  • We randomly assign the bug, rather than myself and Andrew having to drop other work to resolve

@Julesssss Julesssss added the DeployBlockerCash This issue or pull request should block deployment label Oct 1, 2024
Copy link

melvin-bot bot commented Oct 1, 2024

Triggered auto assignment to @lakchote (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@github-actions github-actions bot added Hourly KSv2 and removed Daily KSv2 labels Oct 1, 2024
Copy link
Contributor

github-actions bot commented Oct 1, 2024

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@Julesssss
Copy link
Contributor Author

Hey @lakchote (and FYI @jasperhuangg)

This is a HybridApp bug that pretty much bricks the app. For the first time we will treat this as a NewDot blocker, as the regression was caused by a newDot PR on the current checklist and it blocks us from shipping HybridApp releases/fixes.

This is the first step in a new process we have been planning for, and @andrew and myself are here to help to document any difficulties or questions that arise. Here is a Stackoverflow post that documents some tips and differences in the triage process.

@AndrewGable and myself are here to help answer any questions and help with the process, and we can also seek help from SWM. We can also review the blocking status if the rest of the App checklist ends up being complete before this issue is solved.

@lakchote
Copy link
Contributor

lakchote commented Oct 1, 2024

@Julesssss

I think we should leverage SWM to gain a headstart on this given the urgency, as I have no previous experience working on HybridApp. The more diligent eyes on this, the better. What are your thoughts?

For the rest of my questions, I'll DM you to not bloat this issue.

@Julesssss
Copy link
Contributor Author

Sure, I have tagged our SWM friends here.

I appreciate it's not easy, but we'll need everyone in the team to gain familiarity with HybridApp very soon. Please ask any questions here so we can document the process and make it easy for the next deploy blocker 👍

We have verified reproduction, but that could be aa good first step for you as you are unfamiliar. Next, building the app would be good. The readme steps should make this simple and quite a few engineers have been able to do so already. At this point you should be able to git bisect or manually checkout commits to find the place the bug was introduced by using the submodule (Mobile-Expensify/react-native is a clone of App)

@lakchote
Copy link
Contributor

lakchote commented Oct 1, 2024

Thanks for tagging SWM.

And yes, I'm with you, we need every engineer to become familiar with it. We can't have 2-3 engineers familiar with it, if there is a problem that needs to be handled, we need to be able to solve it regardless.

I feel like reaching out to SWM while I investigate is the best of both worlds as I gain experience from it AND the likelihood for the problem to be solved before next App release increases too.

I haven't had any trouble building the app nor reproducing the bug.

The first problem I've encountered:
I wasn't hitting my dev environment for my requests.

Solution: update .env, in react-native folder, and rebuild.
Maybe we should add a line for this to the README to save time and make sure we don't miss it when we run the project?

@mateuuszzzzz
Copy link
Contributor

mateuuszzzzz commented Oct 1, 2024

It might be caused by the fact we haven't merged OldDot part of onboarding fix .

Honestly, I have doubts, but I can't say that I'm 100% sure until I verify it.

@Julesssss
Copy link
Contributor Author

Maybe we should add a line for this to the README to save time and make sure we don't miss it when we run the project?

We do have a couple of .env PRs in progress (example), lets review this once they are all merged.

@Julesssss
Copy link
Contributor Author

Just noting that we may also need to bump the submodule commit.

@staszekscp
Copy link
Contributor

Hey @Julesssss! Even though I have a TestFlight build, and accounts using NewDot, I am unable to reproduce it... Does it happen on your account and are there any prerequisites to reproduce the crash?

@lakchote
Copy link
Contributor

lakchote commented Oct 1, 2024

I'm currently stuck while rebuilding on Android:

> Task :installDebug FAILED Installing APK 'Expensify-debug.apk' on 'Pixel_3a_API_30(AVD) - 11' for ::debug Unable to install /Users/lucien/Expensidev/Mobile-Expensify/Android/build/outputs/apk/debug/Expensify-debug.apk com.android.ddmlib.InstallException: INSTALL_FAILED_VERSION_DOWNGRADE

I've tried deleting the app in Android studio already.

I've tried building on iOS to save time and wasn't able to do so:

Mobile-Expensify/iOS/Pods/SDCAlertView/Source/AlertController.swift:132:42: 'Transition' is only available in iOS 18.0 or newer

I've also followed the iOS troubleshooting steps here.

This makes it hard to test whether this PR solves it or not.

@staszekscp
Copy link
Contributor

@lakchote INSTALL_FAILED_VERSION_DOWNGRADE probably indicates that on your device there is an Expensify app installed, that is newer than the version you have built. If you delete the app from your device the adb install -r ./build/outputs/apk/debug/Expensify-debug.apk command executed in Mobile-Expensify/android directory should successfully install the application

As per iOS - what is your XCode version?

@lakchote
Copy link
Contributor

lakchote commented Oct 1, 2024

@lakchote INSTALL_FAILED_VERSION_DOWNGRADE probably indicates that on your device there is an Expensify app installed, that is newer than the version you have built. If you delete the app from your device the adb install -r ./build/outputs/apk/debug/Expensify-debug.apk command executed in Mobile-Expensify/android directory should successfully install the application

As per iOS - what is your XCode version?

Thanks for your answer, I'm going to try what you've said for Android. My XCode version is 16.0.

Here's what I've done to reproduce the bug @staszekscp, maybe you can try it to see if you can reproduce it too?

  1. Created a new account
  2. Ran this in the console in OldDot:
const nvp = {
  classicRedirect: {
    dismissed: true,
  }
};
NVP.set('tryNewDot', nvp);
  1. Launched Expensify on HybridApp, clicked on Try new dot menu option.

@staszekscp
Copy link
Contributor

Thanks for the answer! Unfortunately there is a chance that your XCode version is too high... I use 15.4 myself, and I have no problems with the build. Another reason is that you may have accidentaly bumped the SDCAlertView version, but I rather doubt that - just to make sure - what is the version you have in the Podfile.lock file? It should be 11.0

Also, thanks for the reproduction steps! Unfortunately whenever I create a new account via expensify.com I seem to be stuck on this screen... I when I click the link in the e-mail It just shows me the magic code, but I'm unable to provide it...

image

@Julesssss
Copy link
Contributor Author

Julesssss commented Oct 1, 2024

Does it happen on your account and are there any prerequisites to reproduce the crash?

Yeah it's happening on multiple accounts for me (assuming they are set to new experience). It occurs on existing accounts as well as new accounts.

Also, thanks for the reproduction steps! Unfortunately whenever I create a new account via expensify.com I seem to be stuck on this screen...

Ah odd, and there isn't a link provided within the email?

@staszekscp
Copy link
Contributor

Ok, I think that iOS problem is definitely related to the XCode, which introduced Transition in iOS 18 (XCode 15.4 doesn't support it yet, therefore there is no error). I think we need to upgrade SDCAlertView in order to avoid the problem in the nearest future

The fix for the clash was introduced here

@lakchote
Copy link
Contributor

lakchote commented Oct 1, 2024

SDCAlertView version is 11.0.

Also, thanks for the reproduction steps! Unfortunately whenever I create a new account via expensify.com I seem to be stuck on this screen... I when I click the link in the e-mail It just shows me the magic code, but I'm unable to provide it...

Hmm, I had this problem on dev, I had to update my .env in react-native folder to use ngrok, and rebuild. Otherwise it would point to production server.

@lakchote
Copy link
Contributor

lakchote commented Oct 1, 2024

Ok, I think that iOS problem is definitely related to the XCode, which introduced Transition in iOS 18 (XCode 15.4 doesn't support it yet, therefore there is no error). I think we need to upgrade SDCAlertView in order to avoid the problem in the nearest future

The fix for the clash was introduced here

Hmm, that's interesting. I think we'll encounter the problem down the line yes, for people with newest XCode versions.

What do you think @Julesssss? We could do it in a separate PR as a follow-up.

@Julesssss
Copy link
Contributor Author

What do you think @Julesssss? We could do it in a separate PR as a follow-up.

I think for sure that is a separate issue as long as we're able to build and verify the fix (worst case: Android locally, Testflight build for iOS)

@Julesssss
Copy link
Contributor Author

Created a new account

I just noticed this btw. It occurs on existing accounts, no need to create new accounts.

@staszekscp
Copy link
Contributor

@Julesssss what is the iOS version on your device? I start wondering if it's not caused by iOS18? 😄

@tgolen
Copy link
Contributor

tgolen commented Oct 1, 2024

Hi all, just as a heads up, while I have been able to consistently reproduce this, I got the latest version from testflight 9.0.42-0 (iOS 17.6.1) last night and I haven't been able to reproduce it since.

@lakchote
Copy link
Contributor

lakchote commented Oct 1, 2024

I just noticed this btw. It occurs on existing accounts, no need to create new accounts.

Got it, it was to ensure I've entered with a fresh state to debug.

--

I was able to rebuild finally on Android thanks to @staszekscp.

While checking out the branch adjust-old-dot-to-onboarding-refactor from this PR, the bug seems to not be present anymore! I'd like someone to retest it to confirm, but that's good news.

Screen.Recording.2024-10-01.at.16.50.47.mov

@Julesssss
Copy link
Contributor Author

Hi all, just as a heads up, while I have been able to consistently reproduce this, I got the latest version from testflight 9.0.42-0 (iOS 17.6.1) last night and I haven't been able to reproduce it since.

@tgolen could you please try completely uninstalling the app and then re-installing? This sounds similar to my experience this morning, and it would be great to confirm this is easier to reproduce on a fresh install.

@Julesssss
Copy link
Contributor Author

Here's my reproduction. I'm following the steps listed at the top of the issue, but making sure to uninstall the app before reinstalling:

8E459400-B26A-4865-85CA-1036631AA1AE.MP4

@Julesssss
Copy link
Contributor Author

Julesssss commented Oct 1, 2024

Ah that's great news @lakchote 👍

Let's merge that PR and retest. We just need to wait for the next App build to be triggered (via CP or checklist completion). Then we can test the fix on HybridApp Testflight/Google Play beta

@tgolen
Copy link
Contributor

tgolen commented Oct 1, 2024 via email

@jasperhuangg
Copy link
Contributor

@tgolen You should be able to expire your authToken if you get someone in ring1 to run this query

REPLACE INTO nameValuePairs (accountID, name, value, created) VALUES (<mainAccountID>, 'private_minimumAuthTokenIssueTime', strftime('%s', 'now', 'utc') || '000000', Date('now'));

@tgolen
Copy link
Contributor

tgolen commented Oct 1, 2024

Hm, even waiting til it naturaly expired, the app opened right up and loaded the LHN like I expected. So I still wasn't able to reproduce it.

@jasperhuangg
Copy link
Contributor

Cool, @tgolen if you can't reproduce this then think it should be safe to remove the blocker label based on this.

@jasperhuangg jasperhuangg added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Oct 1, 2024
@lakchote
Copy link
Contributor

lakchote commented Oct 2, 2024

@Julesssss issue not reproducible on the new build (9.0.42-3):

RPReplay_Final1727864718.MP4

@lakchote
Copy link
Contributor

lakchote commented Oct 2, 2024

Closing the issue since the problem isn't reproductible anymore. (Discussed it with @Julesssss beforehand, as I'm not used to HybridApp process).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daily KSv2 Engineering Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

No branches or pull requests

7 participants