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

[$250] Profile - After the user's address is saved, Address Line 2 is added to Address Line 1 #45765

Closed
4 of 6 tasks
lanitochka17 opened this issue Jul 19, 2024 · 38 comments
Closed
4 of 6 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

Comments

@lanitochka17
Copy link

lanitochka17 commented Jul 19, 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.9-1
Reproducible in staging?: Y
Reproducible in production?: 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/4738169
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open App or go to staging.new.expensify.com
  2. Login with any account
  3. Go to Settings > Profile > Private > Address
  4. Add any address in Address Line 1, Line 2 and in other fields
  5. Save address
  6. Open saved address

Expected Result:

All address fields are saved correctly

Actual Result:

Contents of Address Line 2 was added to the end of Address Line 1. Field "Address Line 2" is empty

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6546667_1721338922580.iOS-Address-2-added-to-Address-1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015086577f7d57dabf
  • Upwork Job ID: 1817941170058231435
  • Last Price Increase: 2024-07-29
  • Automatic offers:
    • nyomanjyotisa | Contributor | 103594215
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

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

We think that this bug might be related to #vip-vsp

@lanitochka17
Copy link
Author

@JmillsExpensify 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

@FitseTLT
Copy link
Contributor

FitseTLT commented Jul 19, 2024

Proposal

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

Profile - After the user's address is saved, Address Line 2 is added to Address Line 1

What is the root cause of that problem?

We are saving both street and street2 in street separating with new line

return `${street1}\n${street2}`;
}

But we are not extracting street2 properly here
const {street, street2} = address ?? {};
const [currentCountry, setCurrentCountry] = useState(address?.country);

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

We can start saving them separately by creating street2 prop privatePersonalDetails?.address and then we can displaying them easily by accessing the props
or we can also extract the street2 by assigning the string after newline to street2 like

const {street: bothStreets} = address ?? {};
    const streetArr = bothStreets?.split('\n');
    const street = streetArr?.[0];
    const street2 = streetArr?.[1];

What alternative solutions did you explore? (Optional)

@nyomanjyotisa
Copy link
Contributor

Proposal

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

After the user's address is saved, Address Line 2 is added to Address Line 1

What is the root cause of that problem?

Street value from API response are combined for Street 1 and Street 2, separated by \n
image

And we don't handle it here

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

Handle the street value with \n from API response to separate it to Street 1 and Street 2

    const { street } = address ?? {};
    const [street1, street2] = street ? street.split('\n') : [undefined, undefined];

And change this to

street1={street1}

RESULT
image

What alternative solutions did you explore? (Optional)

@FitseTLT
Copy link
Contributor

FitseTLT commented Jul 19, 2024

Updated to fix a typo /n to \n

@Krishna2323
Copy link
Contributor

Krishna2323 commented Jul 19, 2024

Proposal

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

Profile - After the user's address is saved, Address Line 2 is added to Address Line 1

What is the root cause of that problem?

We already have addressLine1 and addressLine2 property in Address but we aren't using that.

address: {
street: PersonalDetailsUtils.getFormattedStreet(street, street2),
city,
state,
zip,
country,
},

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

We are already sending street & street2 to backend as homeAddressStreet & addressStreet2, we can update the backend to return homeAddressStreet & addressStreet2 as addressLine1 and addressLine2 and then we can use addressLine1 and addressLine2 in AddressPage.

const parameters: UpdateHomeAddressParams = {
homeAddressStreet: street,
addressStreet2: street2,
homeAddressCity: city,
addressState: state,
addressZipCode: zip,
addressCountry: country,
};

What alternative solutions did you explore? (Optional)

We should save addressLine1 and addressLine2 separately in Address object.

                    address: {
                        street: PersonalDetailsUtils.getFormattedStreet(street, street2),
                        addressLine1:street,
                        addressLine2:street2,
                        city,
                        state,
                        zip,
                        country,
                    },

And then use addressLine1 and addressLine2 in AddressPage and pass it as street1={addressLine1} and street2={addressLine2}
const {addressLine1, addressLine2} = address ?? {};

We can use street & street2 as fallback if addressLine1 and addressLine2 doesn't exist.

@Krishna2323
Copy link
Contributor

Proposal Updated

  • Added alternative
  • Updated main solution

@melvin-bot melvin-bot bot added the Overdue label Jul 22, 2024
Copy link

melvin-bot bot commented Jul 22, 2024

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

Copy link

melvin-bot bot commented Jul 24, 2024

@JmillsExpensify Huh... This is 4 days overdue. Who can take care of this?

Copy link

melvin-bot bot commented Jul 26, 2024

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

@JmillsExpensify
Copy link

Adding this to wave-collect since it's about private addresses, which is used for the bank/reimbursement flow. I'm also opening up to the community.

@melvin-bot melvin-bot bot removed the Overdue label Jul 29, 2024
@JmillsExpensify JmillsExpensify added the External Added to denote the issue can be worked on by a contributor label Jul 29, 2024
@melvin-bot melvin-bot bot changed the title Profile - After the user's address is saved, Address Line 2 is added to Address Line 1 [$250] Profile - After the user's address is saved, Address Line 2 is added to Address Line 1 Jul 29, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 29, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

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

@thesahindia
Copy link
Member

I am not sure if we wanna handle this in back end or front end. Gonna wait for internal engineer's opinion.

🎀 👀 🎀 C+ reviewed (using it to get the internal engineer assigned here)

Copy link

melvin-bot bot commented Jul 30, 2024

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

@thesahindia
Copy link
Member

thesahindia commented Jul 30, 2024

We are already sending street & street2 to backend as homeAddressStreet & addressStreet2, we can update the backend to return homeAddressStreet & addressStreet2 as addressLine1 and addressLine2 and then we can use addressLine1 and addressLine2 in AddressPage.

@marcochavezf, can we make this change in the backend? Or should we handle this issue in the front-end like mentioned in #45765 (comment)?

Copy link

melvin-bot bot commented Aug 2, 2024

@JmillsExpensify @marcochavezf @thesahindia 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!

@marcochavezf
Copy link
Contributor

Not overdue, PR is WIP

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Overdue Daily KSv2 labels Aug 23, 2024
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Sep 18, 2024
Copy link

melvin-bot bot commented Sep 18, 2024

This issue has not been updated in over 15 days. @JmillsExpensify, @marcochavezf, @nyomanjyotisa, @thesahindia eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@trjExpensify
Copy link
Contributor

The PR for this hit prod a month ago...

@trjExpensify trjExpensify added Daily KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review Monthly KSv2 labels Sep 30, 2024
@JmillsExpensify
Copy link

Payment summary:

@melvin-bot melvin-bot bot added Overdue Daily KSv2 and removed Overdue Daily KSv2 labels Oct 2, 2024
@garrettmknight
Copy link
Contributor

$250 approved for @thesahindia

@melvin-bot melvin-bot bot added the Overdue label Oct 8, 2024
@JmillsExpensify
Copy link

All contributors paid out, so closing.

@melvin-bot melvin-bot bot removed the Overdue label Oct 9, 2024
@github-project-automation github-project-automation bot moved this from Release 2.5: SuiteWorld (Sept 9th) to Done in [#whatsnext] #wave-collect Oct 9, 2024
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
Projects
No open projects
Status: Done
Development

No branches or pull requests

9 participants