Skip to content

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

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com 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): applausetester+071824dr032@applause.expensifail.com
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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 19, 2024
  2. melvin-bot commented on Jul 19, 2024

    @melvin-bot

    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.

  3. lanitochka17 commented on Jul 19, 2024

    @lanitochka17
    Author

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

  4. lanitochka17 commented on Jul 19, 2024

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

  5. FitseTLT commented on Jul 19, 2024

    @FitseTLT
    Contributor

    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)

  6. nyomanjyotisa commented on Jul 19, 2024

    @nyomanjyotisa
    Member

    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)

  7. FitseTLT commented on Jul 19, 2024

    @FitseTLT
    Contributor

    Updated to fix a typo /n to \n

  8. Krishna2323 commented on Jul 19, 2024

    @Krishna2323
    Contributor

    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.

  9. Krishna2323 commented on Jul 19, 2024

    @Krishna2323
    Contributor

    Proposal Updated

    • Added alternative
    • Updated main solution
  10. melvin-bot commented on Jul 22, 2024

    @melvin-bot

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

  11. melvin-bot commented on Jul 24, 2024

    @melvin-bot

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

  12. melvin-bot commented on Jul 26, 2024

    @melvin-bot

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

  13. 53 remaining items

  14. JmillsExpensify commented on Oct 2, 2024

    @JmillsExpensify
    Contributor

    Payment summary:

  15. garrettmknight commented on Oct 8, 2024

    @garrettmknight
    Contributor

    $250 approved for @thesahindia

  16. JmillsExpensify commented on Oct 9, 2024

    @JmillsExpensify
    Contributor

    All contributors paid out, so closing.

  17. moved this from Release 2.5: SuiteWorld (Sept 9th) to Done in [#whatsnext] #wave-collecton Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions