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

[$500] Hybrid - Bank account - App crashes when Onfido screen shows up #51865

Open
2 of 8 tasks
lanitochka17 opened this issue Nov 1, 2024 · 51 comments
Open
2 of 8 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Overdue

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 1, 2024

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: 9.0.56-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5170744
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Sign in on staging.new.expensify.com on web
  2. Create a workspace and start a bank account flow (Go through the plaid flow only)
  3. If you're using expensifail account go to OD on web and paste NVP.set('tryNewDot', {classicRedirect: {dismissed: "true"}​}); to enable access to new expensify on hybrid app
  4. Sign in on hybrid app with the same account
  5. Go to workspace > Workflow and click on bank account
  6. Click on continue setup
  7. Go through the flow until Onfido screen

Expected Result:

App works fine

Actual Result:

App crashes

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
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6652056_1730454634072.Screen_Recording_20241101_123745.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021856252175272588482
  • Upwork Job ID: 1856252175272588482
  • Last Price Increase: 2025-01-20
  • Automatic offers:
    • shubham1206agra | Contributor | 105810475
Issue OwnerCurrent Issue Owner: @adelekennedy
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 1, 2024
Copy link

melvin-bot bot commented Nov 1, 2024

Triggered auto assignment to @adelekennedy (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.

@lanitochka17
Copy link
Author

@adelekennedy FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@melvin-bot melvin-bot bot added the Overdue label Nov 4, 2024
Copy link

melvin-bot bot commented Nov 4, 2024

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

@adelekennedy
Copy link

hmmm I'm struggling to reproduce on browserstack but that may be user error, asking for a buddy check

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 6, 2024
Copy link

melvin-bot bot commented Nov 11, 2024

@adelekennedy Eep! 4 days overdue now. Issues have feelings too...

@adelekennedy adelekennedy added the External Added to denote the issue can be worked on by a contributor label Nov 12, 2024
Copy link

melvin-bot bot commented Nov 12, 2024

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

@melvin-bot melvin-bot bot changed the title Hybrid - Bank account - App crashes when Onfido screen shows up [$250] Hybrid - Bank account - App crashes when Onfido screen shows up Nov 12, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 12, 2024
Copy link

melvin-bot bot commented Nov 12, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Nov 12, 2024
Copy link

melvin-bot bot commented Nov 15, 2024

@Ollyws @adelekennedy 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 melvin-bot bot added the Overdue label Nov 15, 2024
Copy link

melvin-bot bot commented Nov 15, 2024

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

Copy link

melvin-bot bot commented Nov 19, 2024

@Ollyws, @adelekennedy 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

Copy link

melvin-bot bot commented Nov 19, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@Ollyws
Copy link
Contributor

Ollyws commented Nov 20, 2024

Still awaiting proposals...

@melvin-bot melvin-bot bot removed the Overdue label Nov 20, 2024
Copy link

melvin-bot bot commented Nov 26, 2024

@Ollyws, @adelekennedy Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Overdue label Nov 26, 2024
Copy link

melvin-bot bot commented Nov 26, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Nov 28, 2024

@Ollyws, @adelekennedy 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

Copy link

melvin-bot bot commented Nov 29, 2024

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

Copy link

melvin-bot bot commented Jan 16, 2025

@Ollyws, @adelekennedy Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Jan 20, 2025

@Ollyws, @adelekennedy 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

@muttmuure
Copy link
Contributor

Do you have to set the NVP to reproduce this? It seems pretty niche

@muttmuure muttmuure moved this to MEDIUM in [#whatsnext] #quality Jan 20, 2025
@muttmuure
Copy link
Contributor

I'm going to make it MEDIUM but if we think this is worse than that, please let me know

Copy link

melvin-bot bot commented Jan 20, 2025

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@shubham1206agra
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

App crashes when Onfido screen shows up

What is the root cause of that problem?

When we initialize Onfido process, we see 2 errors

java.lang.RuntimeException: Unable to create service com.onfido.android.sdk.capture.ui.OnfidoStarterService: java.lang.IllegalStateException: Can't set data directory suffix: WebView already initialized
FATAL EXCEPTION: main
Process: org.me.mobiexpensifyg.dev:onfido_process, PID: 6532
java.lang.RuntimeException: Unable to create service com.onfido.android.sdk.capture.ui.OnfidoStarterService: java.lang.IllegalStateException: Can't set data directory suffix: WebView already initialized
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4499)
at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2161)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7924)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Caused by: java.lang.IllegalStateException: Can't set data directory suffix: WebView already initialized
at android.webkit.WebViewFactory.setDataDirectorySuffix(WebViewFactory.java:231)
at android.webkit.WebView.setDataDirectorySuffix(WebView.java:2057)
at com.onfido.android.sdk.capture.ui.OnfidoStarterService.onCreate(Unknown Source:11)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4486)
java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process org.me.mobiexpensifyg.dev:onfido_process. Make sure to call FirebaseApp.initializeApp(Context) first.
FATAL EXCEPTION: main
Process: org.me.mobiexpensifyg.dev:onfido_process, PID: 7807
                                                                                                    java.lang.ExceptionInInitializerError
                                                                                                    	at com.google.firebase.perf.config.RemoteConfigManager.getInstance(RemoteConfigManager.java:119)
                                                                                                    	at com.google.firebase.perf.config.ConfigResolver.<init>(ConfigResolver.java:78)
                                                                                                    	at com.google.firebase.perf.config.ConfigResolver.getInstance(ConfigResolver.java:86)
                                                                                                    	at com.google.firebase.perf.application.AppStateMonitor.<init>(AppStateMonitor.java:98)
                                                                                                    	at com.google.firebase.perf.application.AppStateMonitor.getInstance(AppStateMonitor.java:87)
                                                                                                    	at com.google.firebase.perf.metrics.NetworkRequestMetricBuilder.<init>(NetworkRequestMetricBuilder.java:92)
                                                                                                    	at com.google.firebase.perf.metrics.NetworkRequestMetricBuilder.builder(NetworkRequestMetricBuilder.java:84)
                                                                                                    	at com.google.firebase.perf.network.InstrumentOkHttpEnqueueCallback.<init>(InstrumentOkHttpEnqueueCallback.java:42)
                                                                                                    	at com.google.firebase.perf.network.FirebasePerfOkHttpClient.enqueue(FirebasePerfOkHttpClient.java:73)
                                                                                                    	at retrofit2.OkHttpCall.enqueue(OkHttpCall.java:147)
                                                                                                    	at retrofit2.adapter.rxjava3.CallEnqueueObservable.subscribeActual(CallEnqueueObservable.java:42)
                                                                                                    	at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13131)
                                                                                                    	at retrofit2.adapter.rxjava3.BodyObservable.subscribeActual(BodyObservable.java:35)
                                                                                                    	at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13131)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:36)
                                                                                                    	at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4813)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.single.SingleFlatMap$SingleFlatMapCallback.onSuccess(SingleFlatMap.java:85)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:55)
                                                                                                    	at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4813)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.single.SingleFlatMap.subscribeActual(SingleFlatMap.java:37)
                                                                                                    	at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4813)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.single.SingleResumeNext.subscribeActual(SingleResumeNext.java:39)
                                                                                                    	at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4813)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.single.SingleToFlowable.subscribeActual(SingleToFlowable.java:38)
                                                                                                    	at io.reactivex.rxjava3.core.Flowable.subscribe(Flowable.java:15868)
                                                                                                    	at io.reactivex.rxjava3.core.Flowable.subscribe(Flowable.java:15814)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.flowable.FlowableRetryPredicate$RetrySubscriber.subscribeNext(FlowableRetryPredicate.java:124)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.flowable.FlowableRetryPredicate.subscribeActual(FlowableRetryPredicate.java:42)
                                                                                                    	at io.reactivex.rxjava3.core.Flowable.subscribe(Flowable.java:15868)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.flowable.FlowableSingleSingle.subscribeActual(FlowableSingleSingle.java:39)
                                                                                                    	at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4813)
                                                                                                    	at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4799)
                                                                                                    	at com.onfido.android.sdk.capture.internal.util.logging.LoggerRepository.sendLogs(Unknown Source:63)
                                                                                                    	at com.onfido.android.sdk.capture.internal.util.logging.LoggerRepository.log$onfido_capture_sdk_core_release(Unknown Source:12)
                                                                                                    	at com.onfido.android.sdk.capture.internal.util.logging.RemoteLoggerTree.sendToRemote(Unknown Source:112)
                                                                                                    	at com.onfido.android.sdk.capture.internal.util.logging.RemoteLoggerTree.log(Unknown Source:21)
                                                                                                    	at com.onfido.android.sdk.capture.internal.util.logging.Timber$Tree.prepareLog(Unknown Source:69)
                                                                                                    	at com.onfido.android.sdk.capture.internal.util.logging.Timber$Tree.log(Unknown Source:11)
                                                                                                    	at com.onfido.android.sdk.capture.internal.util.logging.Timber$Forest.log(Unknown Source:20)
                                                                                                    	at com.onfido.android.sdk.capture.internal.usecase.DFMClassCheckUseCase.invoke(Unknown Source:34)
                                                                                                    	at com.onfido.android.sdk.capture.ui.OnfidoPresenter.setup$onfido_capture_sdk_core_release(Unknown Source:38)
2025-01-18 18:34:24.306  7807-7807  AndroidRuntime          org.me.mobiexpensifyg.dev            E  	at com.onfido.android.sdk.capture.ui.OnfidoActivity.setupPresenterWith(Unknown Source:46)
                                                                                                    	at com.onfido.android.sdk.capture.ui.OnfidoActivity.onCreate(Unknown Source:54)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8342)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8321)
                                                                                                    	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
                                                                                                    	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3626)
                                                                                                    	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)
                                                                                                    	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:201)
                                                                                                    	at android.os.Looper.loop(Looper.java:288)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:7924)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
                                                                                                    Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process org.me.mobiexpensifyg.dev:onfido_process. Make sure to call FirebaseApp.initializeApp(Context) first.
                                                                                                    	at com.google.firebase.FirebaseApp.getInstance(FirebaseApp.java:179)
                                                                                                    	at com.google.firebase.perf.config.RemoteConfigManager.getInitialStartupMillis(RemoteConfigManager.java:91)
                                                                                                    	at com.google.firebase.perf.config.RemoteConfigManager.<init>(RemoteConfigManager.java:85)
                                                                                                    	at com.google.firebase.perf.config.RemoteConfigManager.<clinit>(RemoteConfigManager.java:52)

What changes do you think we should make in order to solve the problem?

To fix the errors, we need to stop re-initialization of views which are unnecessary in onfido process.

For that, we will add the conditional to early return when the process is onfido_process in Expensify.java and Yapl.java using isOnfidoProcess function.

Code

private boolean isOnfidoProcess(Context context) {
      int currentPid = Process.myPid();
      ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);

      for (ActivityManager.RunningAppProcessInfo processInfo : manager.getRunningAppProcesses()) {
          if (processInfo.pid == currentPid) {
              return processInfo.processName.endsWith(":onfido_process");
          }
      }

      return false;
  }

For fixing Firebase error, we will use FirebaseApp.initializeApp(this); inside Yapl.java onCreate function when the process is onfido_process.

Result

Screen.Recording.2025-01-21.at.10.36.30.PM.mov

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

NA since this change is related to HybridApp.

What alternative solutions did you explore? (Optional)

@shubham1206agra
Copy link
Contributor

@Ollyws I discussed this solution with @mateuuszzzzz, and he seems to be fine with the approach.

@adelekennedy
Copy link

@Ollyws is on it for review, melvin

@melvin-bot melvin-bot bot removed the Overdue label Jan 22, 2025
@Ollyws
Copy link
Contributor

Ollyws commented Jan 22, 2025

@shubham1206agra's proposal LGTM.
🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Jan 22, 2025

Triggered auto assignment to @thienlnam, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 22, 2025
Copy link

melvin-bot bot commented Jan 22, 2025

📣 @shubham1206agra 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@shubham1206agra
Copy link
Contributor

Copy link

melvin-bot bot commented Jan 28, 2025

@Ollyws, @thienlnam, @shubham1206agra, @adelekennedy Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Jan 28, 2025
@adelekennedy
Copy link

looks like the PR has been merged and closed?

@shubham1206agra
Copy link
Contributor

@adelekennedy PR is on production now.

Copy link

melvin-bot bot commented Jan 30, 2025

@Ollyws, @thienlnam, @shubham1206agra, @adelekennedy Still overdue 6 days?! Let's take care of this!

Copy link

melvin-bot bot commented Feb 3, 2025

@Ollyws, @thienlnam, @shubham1206agra, @adelekennedy 10 days overdue. I'm getting more depressed than Marvin.

@shubham1206agra
Copy link
Contributor

@adelekennedy This was fixed with https://github.com/Expensify/Mobile-Expensify/pull/13381. Can you prepare for payment?

@adelekennedy adelekennedy added the Awaiting Payment Auto-added when associated PR is deployed to production label Feb 4, 2025
@adelekennedy
Copy link

Payment due 02/10/25

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Feb 4, 2025
Copy link

melvin-bot bot commented Feb 7, 2025

@Ollyws, @thienlnam, @shubham1206agra, @adelekennedy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Overdue
Projects
Status: MEDIUM
Development

No branches or pull requests

8 participants