Skip to content

[HybridApp][MEDIUM] Improvement to HybridApp TTI / NewDot authentication page #49844

Open
@Julesssss

Description

@Julesssss

P/S authored by @staszekscp here

Problem

The TTI on HybridApp is longer than on a standalone NewDot application. In order to determine if a specific user should go to NewDot, HybridApp has to boot OldDot code first. The business logic for OldDot was written in JS in a framework called YAPL, and it runs on JSC.

Solution

Let’s replace JSC with Hermes! Hermes is known for its advantage over JSC in initial boot time, and it became a standard in the React Native world. Since YAPL is written in JS, theoretically should be able to do that, and get rid of JSC from the project. As bonus the app size would become smaller, too. 💪:skin-tone-2: 🚀

However, I’d like to emphasise that, since YAPL has been written in legacy JavaScript (mostly pre ES2015) there is a chance that the migration may become very time-consuming. Nevertheless I think it is worth to do at least a research, and see how far we can get, because it will speed up the both, OldDot, and HybridApp!

Mateusz' updated Solution

Adjust the current authentication flow on HybridApp to replace the OldDot sign-in page with the NewDot version.

  1. Currently, we perform authentication on the OldDot side and pass all necessary credentials to enable the New Experience and handle authentication/re-authentication. We could reverse this by using the NewDot sign-in page to generate all required credentials. These credentials could then be used to authenticate on the OldDot side. To trigger authentication on YAPL side, native methods can be used.
  2. We also need to decide at the start of sign-in whether the user should be redirected to OldDot or NewDot. The SignInUser command should return an additional field with nvp_tryNewDot, allowing us to determine based on the value of the dismissed key whether to stay on NewDot or transition to OldDot.
  3. Another important aspect from the user’s perspective is error handling. OldDot initialisation might fail, so we should be able to display errors on the SignIn page, just as we do when NewDot authentication fails. We can track OldDot initialisation through native events and store the current state in Onyx. Errors returned by OldDot’s API can then be passed via these events and displayed on the NewDot SignIn page

Metadata

Metadata

Labels

DesignEngineeringImprovementItem broken or needs improvement.InternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Status

MEDIUM

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions