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

[HOLD for payment 2023-09-20] [$1000] Web - Profile - No back button on personal details offline mode #24642

Closed
2 of 6 tasks
izarutskaya opened this issue Aug 16, 2023 · 58 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Aug 16, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open the app
  2. If logged in then logout
  3. Login and switch off internet connection
  4. Visit settings->profile->personal details and observe that page does not have back button while loading

Expected Result:

App should display back button on personal details page while loading on offline mode

Actual Result:

App does not display back button on personal details page while loading on offline mode

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.54-11

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

Notes/Photos/Videos: Any additional supporting documentation

no.back.personal.details.offline.mode.mp4
Recording.1228.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dhanashree-sawant

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691391806874729

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012444d83c2a13626a
  • Upwork Job ID: 1692462598974083072
  • Last Price Increase: 2023-08-25
  • Automatic offers:
    • huzaifa-99 | Contributor | 26416409
    • Dhanashree-Sawant | Reporter | 26416410
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 16, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 16, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@huzaifa-99
Copy link
Contributor

Proposal

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

We want to show the back button when the data for the personal details page is loading.

What is the root cause of that problem?

When the data for personal details page is loading we only show the loading indicator here, instead of also showing the header and back button.

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

We can update the ScrollView here to conditionally render, i.e only if we have loaded the personal details data, otherwise we show the loading indicator

{lodashGet(props.privatePersonalDetails, 'isLoading', true) ?
    <FullscreenLoadingIndicator /> :
    <ScrollView>
        {/*. other code .... */}
    </ScrollView>
}
The FullscreenLoadingIndicator adds an absolute fill which looks like this (notice the header) image

To fix this we have to update some styles, we can follow either of these options after applying the above change

  1. update the styles of FullscreenLoadingIndicator to only fill the available width/height (instead of absolute), replacing StyleSheet.absoluteFillObject with styles.w100, styles.h100
  2. pass a zIndex to <HeaderWithBackButton/> that is greater than the zIndex of FullscreenLoadingIndicator
  3. Pass styles.flex1, styles.pRelative to the FullscreenLoadingIndicator, same as like we do here

Optional:
There are a lot of other places that have the same issue, we can fix all those in the same go.

What alternative solutions did you explore? (Optional)

N/A

@sonialiap
Copy link
Contributor

Triaging to external

@sonialiap sonialiap added the External Added to denote the issue can be worked on by a contributor label Aug 18, 2023
@melvin-bot melvin-bot bot changed the title Web - Profile - No back button on personal details offline mode [$1000] Web - Profile - No back button on personal details offline mode Aug 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 18, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 18, 2023

Triggered auto assignment to @Christinadobrzyn (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Aug 18, 2023

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

@DylanDylann
Copy link
Contributor

DylanDylann commented Aug 18, 2023

Proposal

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

Web - Profile - No back button on personal details offline mode

What is the root cause of that problem?

if (lodashGet(props.privatePersonalDetails, 'isLoading', true)) {
return <FullscreenLoadingIndicator />;
}

If the data is loading, we are only show FullscreenLoadingIndicator

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

The same problem happen on: LegalNamePage, DateOfBirthPage, AddressPage

if (lodashGet(props.privatePersonalDetails, 'isLoading', true)) {
return <FullscreenLoadingIndicator />;
}

if (lodashGet(privatePersonalDetails, 'isLoading', true)) {
return <FullscreenLoadingIndicator />;
}

if (lodashGet(privatePersonalDetails, 'isLoading', true)) {
return <FullscreenLoadingIndicator />;
}

I suggest that we should create new HOC called WithPrivatePersonalDetailsyAndFullscreenLoading like we did in WithPolicyAndFullscreenLoading
And using this HOC for all above places

What alternative solutions did you explore? (Optional)

We can update like this in all above places

{lodashGet(props.privatePersonalDetails, 'isLoading', true) 
            ? <FullscreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
             : <ScrollView>
                    ....
             </ScrollView>
}

Result

Screenshot 2023-08-18 at 18 02 55

@ArekChr
Copy link
Contributor

ArekChr commented Aug 18, 2023

@DylanDylann What is the difference between implementation WithPolicyAndFullscreenLoading and WithPrivatePersonalDetailsyAndFullscreenLoading? Can we use one HOC for that? Both uses FullscreenLoadingIndicator

@s-alves10
Copy link
Contributor

s-alves10 commented Aug 18, 2023

Proposal

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

No back button appears in personal details page in offline mode

What is the root cause of that problem?

As you can see below, we show FullscreenLoadingIndicator whe private personal details is loading. This component has no back button

if (lodashGet(props.privatePersonalDetails, 'isLoading', true)) {
return <FullscreenLoadingIndicator />;
}

This is the root cause

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

We need to move the FullscreenLoadingIndicator below the HeaderWithBackButton component

        {lodashGet(props.privatePersonalDetails, 'isLoading', true) ? (
            <View style={[styles.pRelative, styles.flex1]}>
                <FullscreenLoadingIndicator />
            </View>
        ) : (
            <ScrollView>
                ...
            </ScrollView>
        )}

Wrapping by View would prevent the full page getting dark

This issue exists on other pages as well. Those should be fixed.

Result

image

What alternative solutions did you explore? (Optional)

We can add the wrapper props to the FullscreenLoadingIndicator as follows

function FullScreenLoadingIndicator(props) {
    const additionalStyles = _.isArray(props.style) ? props.style : [props.style];
    const content = (
        <View style={[StyleSheet.absoluteFillObject, styles.fullScreenLoading, ...additionalStyles]}>
            <ActivityIndicator
                color={themeColors.spinner}
                size="large"
            />
        </View>
    );

    return props.wrapper ? (
        <View style={[styles.pRelative, styles.flex1]}>
            {content}
        </View>
    ) : content;
}

@blazejkustra
Copy link
Contributor

blazejkustra commented Aug 18, 2023

Proposal

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

We aim to display the back button while the personal details page is loading data

What is the root cause of that problem?

The problem arises when the data for the personal details page is being loaded; during this time, we only display the loading indicator here. As a result, the back button is not being shown.

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

Extract HeaderWithBackButton component to a variable and reuse it in the loading logic here along with FullscreenLoadingIndicator with additional styles.

Before:

if (lodashGet(props.privatePersonalDetails, 'isLoading', true)) {
    return <FullscreenLoadingIndicator />;
}

After:

const headerWithBackButton = (
    <HeaderWithBackButton
        title={props.translate('privatePersonalDetails.personalDetails')}
        onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_PROFILE)}
    />
);

if (lodashGet(props.privatePersonalDetails, 'isLoading', true)) {
    return (
        <ScreenWrapper>
            {headerWithBackButton}
            <FullscreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
        </ScreenWrapper>
    );
}

☝️ This makes the component much more readable as the 'loading state' of component has its own return statement.

Also change the usage of HeaderWithBackButton in the final return statement here.

Before:

<HeaderWithBackButton
    title={props.translate('privatePersonalDetails.personalDetails')}
    onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_PROFILE)}
/>

After:

{headerWithBackButton}

Optional: Do the same in other similar places as well.

What alternative solutions did you explore? (Optional)

N/A

Result

image

@huzaifa-99
Copy link
Contributor

@ArekChr Did you get a chance to look at my proposal here

@lucentdevteam
Copy link

Hello There,

Please find my solution here

Technical explanation

  1. Implement the "onLine" property from the Navigator interface in the browser to determine the online status.
  2. Display the "ScrollView" exclusively when the connection is online; otherwise, present a loading spinner or an offline symbol.
  3. The required modifications should be made in the file named PersonalDetailsInitialPage.js.

Looking forward to hearing from you.

@melvin-bot
Copy link

melvin-bot bot commented Aug 18, 2023

📣 @lucentdevteam! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@lucentdevteam
Copy link

lucentdevteam commented Aug 18, 2023

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/niteshlucentinnovation

@melvin-bot
Copy link

melvin-bot bot commented Aug 18, 2023

⚠️ Invalid email. Please make sure to create an Expensify account with this email first here.

@lucentdevteam
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/niteshlucentinnovation

@melvin-bot
Copy link

melvin-bot bot commented Aug 18, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@lucentdevteam
Copy link

lucentdevteam commented Aug 18, 2023

Hello There,

Please find my solution here

Technical explanation

  1. Implement the "onLine" property from the Navigator interface in the browser to determine the online status.
  2. Display the "ScrollView" exclusively when the connection is online; otherwise, present a loading spinner or an offline symbol.
  3. The required modifications should be made in the file named PersonalDetailsInitialPage.js.

Looking forward to hearing from you.

Thanks

@lucentdevteam
Copy link

Proposal

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

[$1000] Web - Profile - No back button on personal details offline mode #24642 - Expensify

What is the root cause of that problem?

The error is because of this code
if (lodashGet(props.privatePersonalDetails, 'isLoading', true)) {
return ;
}

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

Move the FullscreenLoadingIndicator to above ScrollView tag and below HeaderWithBackButton .

What alternative solutions did you explore? (Optional)

  • Implement the "onLine" property from the Navigator interface in the browser to determine the online status.
  • Display the "ScrollView" exclusively when the connection is online; otherwise, present a loading spinner or an offline symbol.

@DylanDylann
Copy link
Contributor

@ArekChr The difference between implementation WithPolicyAndFullscreenLoading and WithPrivatePersonalDetailsyAndFullscreenLoading is the prop we use to check if we should show loading screen or not.
In WithPolicyAndFullscreenLoading we use this condition to show loading screen

if (props.isLoadingReportData && _.isEmpty(props.policy)) {
            return <FullscreenLoadingIndicator />;
        }

In WithPrivatePersonalDetailsyAndFullscreenLoading we use another prop to check

 if (lodashGet(props.privatePersonalDetails, 'isLoading', true)) { 
     return <FullscreenLoadingIndicator />; 
 } 

@melvin-bot melvin-bot bot added the Overdue label Aug 21, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

📣 @huzaifa-99 🎉 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 📖

@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

📣 @dhanashree-sawant 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@huzaifa-99
Copy link
Contributor

Thanks for the review guys, PR will be ready shortly

@huzaifa-99
Copy link
Contributor

PR #26346 is ready for review @ArekChr @aldo-expensify

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @huzaifa-99 got assigned: 2023-08-30 17:17:03 Z
  • when the PR got merged: 2023-09-11 13:23:56 UTC
  • days elapsed: 7

On to the next one 🚀

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@huzaifa-99
Copy link
Contributor

This is not a regression/deploy-blocker, more context here

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 13, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - Profile - No back button on personal details offline mode [HOLD for payment 2023-09-20] [$1000] Web - Profile - No back button on personal details offline mode Sep 13, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.68-17 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 2023-09-20. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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:

  • [@ArekChr] The PR that introduced the bug has been identified. Link to the PR:
  • [@ArekChr] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@ArekChr] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@ArekChr] Determine if we should create a regression test for this bug.
  • [@ArekChr] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@sonialiap / @Christinadobrzyn] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@ArekChr
Copy link
Contributor

ArekChr commented Sep 13, 2023

  • Link to the PR: No bug identified.
  • Link to comment: n/a
  • Link to discussion: n/a
  • Determine if we should create a regression test for this bug: I don’t think we need to add a regression test here.

@Christinadobrzyn
Copy link
Contributor

@huzaifa-99 can you accept the Upwork offer here - #24642 (comment)

@huzaifa-99
Copy link
Contributor

Accepted, Thanks @Christinadobrzyn

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Sep 19, 2023
@sonialiap
Copy link
Contributor

@ArekChr does not require payment (Contractor)
@huzaifa-99 fix + bonus = $1500 - paid ✔️
@dhanashree-sawant reporter $250 - paid ✔️

Aug 31 5:41
Sep 1 1:59

@melvin-bot melvin-bot bot removed the Overdue label Sep 22, 2023
@dhanashree-sawant
Copy link

Hi @sonialiap, the offer on upwork is still pending for approval, can you check once you are available?

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests