-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HOLD for payment 2024-07-10] [$250] Login - Onboarding can be skipped if you kill the app after the modal opens #43803
Comments
Triggered auto assignment to @isabelastisser ( |
@isabelastisser 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 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Onboarding can be skipped if we reopen the app or I also found we can skip it if we go to /home on the web. What is the root cause of that problem?The onboarding modal will be shown if the onboarding data is ready. However, we set App/src/libs/actions/Welcome.ts Lines 79 to 82 in 75c104b
which makes this promise never resolved. App/src/libs/actions/Welcome.ts Lines 31 to 32 in 75c104b
On the web, if we go to /home, the issue still happens. If you see the image above, the app already navigates correctly to the onboarding, but somehow it navigates back to the home (/r). It's because, when we open a link, it will trigger this "deep link". Lines 194 to 197 in 75c104b
In our case, the link is home. open home -> navigate to onboarding -> navigate to home This doesn't happen in native because we pass the authenticated status and ignore it if we are authenticated because Lines 200 to 203 in 75c104b
App/src/libs/actions/Report.ts Line 2488 in 75c104b
App/src/libs/actions/Report.ts Lines 2532 to 2534 in 75c104b
What changes do you think we should make in order to solve the problem?To solve the first issue, we need to remove the App/src/libs/actions/Welcome.ts Lines 79 to 81 in 75c104b
For the second issue, we already have the authenticated status in App/src/libs/actions/Report.ts Line 2490 in 75c104b
Then, replace this with App/src/libs/actions/Report.ts Line 2532 in 75c104b
|
I had a proposal to change the checking condition to show onboarding in other issue: The complete rough code is something like: Complete rough code:let resolveIsReadyPromise: (value?: Promise<void>) => void | undefined;
let isServerDataReadyPromise = new Promise<void>((resolve) => {
resolveIsReadyPromise = resolve;
});
let resolveOnboardingFlowStatus: (value?: Promise<void>) => void | undefined;
let isOnboardingFlowStatusKnownPromise = new Promise<void>((resolve) => {
resolveOnboardingFlowStatus = resolve;
});
let resolveRouteIsReady: (value?: Promise<void>) => void | undefined;
let isRouteReadyPromise = new Promise<void>((resolve) => {
resolveRouteIsReady = resolve;
});
let resolveUserIsLoggedIn: (value?: Promise<void>) => void | undefined;
let isUserLoggedInPromise = new Promise<void>((resolve) => {
resolveUserIsLoggedIn = resolve;
});
function onServerDataReady(): Promise<void> {
return isServerDataReadyPromise;
}
const listenToSessionChange = function() {
const sessionConeectionId = Onyx.connect({
key: ONYXKEYS.SESSION,
initWithStoredValues: false,
callback: (session) => {
if (session?.accountID === undefined || session?.authTokenType === CONST.AUTH_TOKEN_TYPES.ANONYMOUS) {
return;
}
resolveUserIsLoggedIn?.();
Onyx.disconnect(sessionConeectionId);
},
});
}
const listenToPathChange = function() {
const connectionId = Onyx.connect({
key: ONYXKEYS.LAST_VISITED_PATH,
initWithStoredValues: true,
callback: (cc) => {
const rootRoute = navigationRef.getRootState()?.routes;
const currentRouteName = rootRoute?.[rootRoute.length - 1]?.name;
if (Boolean(currentRouteName && currentRouteName !== NAVIGATORS.BOTTOM_TAB_NAVIGATOR && currentRouteName !== NAVIGATORS.CENTRAL_PANE_NAVIGATOR)) {
return;
}
resolveRouteIsReady();
Onyx.disconnect(lastVistedConnectID);
},
});
}
const listenToNvpOnboardingChange = function() {
const connectionId = Onyx.connect({
key: ONYXKEYS.NVP_ONBOARDING,
initWithStoredValues: true,
callback: (value) => {
if (value === null || value === undefined) {
return;
}
onboarding = value;
resolveOnboardingFlowStatus();
Onyx.disconnect(connectionId);
},
});
}
function startOnBoarding(){
listenToSessionChange();
isUserLoggedInPromise
.then(() => isServerDataReadyPromise)
.then(() => {
listenToNvpOnboardingChange();
return isOnboardingFlowStatusKnownPromise;
}).then(() => {
listenToPathChange();
return isRouteReadyPromise;
}).then(() => {
if (Array.isArray(onboarding) || onboarding?.hasCompletedGuidedSetupFlow === undefined) {
return;
}
if (onboarding?.hasCompletedGuidedSetupFlow) {
onCompleted?.();
} else {
Navigation.navigate(ROUTES.ONBOARDING_ROOT)
//onNotCompleted?.();
}
return;
});
}
startOnBoarding(); It checks on several onyx values, session (check whether user sign in) -> then check on isDataRedy -> nvp_onboarding check -> last visited path check. It consist of several promises and resolves which will automatically disconnect resolved onyx connection and make new connection to subsequent onyx check. |
Job added to Upwork: https://www.upwork.com/jobs/~01a398eb407ba14887 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws ( |
@bernhardoj's proposal LGTM. |
Triggered auto assignment to @cristipaval, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @bernhardoj 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
PR is ready cc: @Ollyws |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-07-10. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
@Ollyws, please complete the checklist above. Thanks! |
Just FYI, I will request the payment through ND. |
Requested in ND |
Payment summary: @Ollyws $250 C+ review / $250 pending via NewDot |
@Ollyws please complete the BZ list above. Thanks! |
$250 approved for @bernhardoj |
@Ollyws I DM'd you for visibility. |
Apologies still trying to track down the source of this one |
BugZero Checklist:
N/A
Yes
Regression Test Proposal
Do we agree 👍 or 👎 |
Requested in ND. |
@cristipaval, can you please review the regression test above? Thanks! |
yes they are fine |
All set! |
$250 approved for @Ollyws |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
issue found when validating #43648
Version Number: 1.4.84-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: applause internal team
Slack conversation:
Action Performed:
Expected Result:
The modal should be open when I open the app again.
Actual Result:
Onboarding can be skipped if you kill the app after the modal opens.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6514254_1718456579175.New.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @isabelastisserThe text was updated successfully, but these errors were encountered: