Skip to content

[Due for payment 2025-05-22] [Due for payment 2025-02-13] [$250] Workflows - Street doesn't get automatically filled out for a specific address #55295

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.86-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): nathanmulugetatesting+2818@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Create a workspace
  3. Enable workflows
  4. Go through plaid connection method
  5. Go through the flow until step 2 (What's your address?)
  6. Type "1" on street address
  7. Click on "1132 Murphy Ridge Rd" from the options

Expected Result:

Street address gets filled out automatically

Actual Result:

Street address stays empty and validation error is shown

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6714924_1736961211864.bandicam_2025-01-15_20-08-19-028.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021882178300262274254
  • Upwork Job ID: 1882178300262274254
  • Last Price Increase: 2025-01-22
  • Automatic offers:
    • Krishna2323 | Contributor | 105905250
Issue OwnerCurrent Issue Owner: @CortneyOfstad

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 15, 2025
  2. melvin-bot commented on Jan 15, 2025

    @melvin-bot

    Triggered auto assignment to @CortneyOfstad (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. mohit6789 commented on Jan 15, 2025

    @mohit6789
    Contributor

    Proposal

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

    Street doesn't get automatically filled out for a specific address

    What is the root cause of that problem?

    Currently, in input field we are displaying ${street_number} ${route} from here. If ${street_number} ${route} not present then we display street name from here.

    But in some edge-case google place API does not return the street_number, route and street-address, because of that input value set to empty and we see validation error.

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

    To fix this issue we can write below code here.

    if (!values.street && autocompleteData?.structured_formatting?.main_text) {
        values.street = autocompleteData?.structured_formatting?.main_text;
    }
    

    Here if street value is empty then we can show the street name from the autocompleteData.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    UI bug so NA

    What alternative solutions did you explore? (Optional)

  4. Krishna2323 commented on Jan 16, 2025

    @Krishna2323
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-01-16 04:34:46 UTC.

    Proposal

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

    Workflows - Street doesn't get automatically filled out for a specific address

    What is the root cause of that problem?

    • We are getting the streetNumber & streetName using GooglePlacesUtils.getAddressComponents(addressComponents but for some locations the addressComponents doesn't include the streetNumber & streetName.
      // Gather the values from the Google details
      const {
      street_number: streetNumber,
      route: streetName,
      subpremise,
      locality,
      sublocality,
      postal_town: postalTown,
      postal_code: zipCode,
      administrative_area_level_1: state,
      administrative_area_level_2: stateFallback,
      country: countryPrimary,
      } = GooglePlacesUtils.getAddressComponents(addressComponents, {
      // eslint-disable-next-line @typescript-eslint/naming-convention
      street_number: 'long_name',
      route: 'long_name',
      subpremise: 'long_name',
      locality: 'long_name',
      sublocality: 'long_name',
      // eslint-disable-next-line @typescript-eslint/naming-convention
      postal_town: 'long_name',
      // eslint-disable-next-line @typescript-eslint/naming-convention
      postal_code: 'long_name',
      // eslint-disable-next-line @typescript-eslint/naming-convention
      administrative_area_level_1: 'short_name',
      // eslint-disable-next-line @typescript-eslint/naming-convention
      administrative_area_level_2: 'long_name',
      country: 'short_name',
      });

      street: `${streetNumber} ${streetName}`.trim(),

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

    • First we need to update getPlaceAutocompleteTerms to also return streetNumber, we can do that by simply adding streetNumber to fieldsToExtract.
      type GetPlaceAutocompleteTermsResultKey = 'country' | 'state' | 'city' | 'street';

      /**
      * Finds an address term by type, and returns the value associated to key. Note that each term in the address must
      * conform to the following ORDER: <street, city, state, country>
      */
      function getPlaceAutocompleteTerms(addressTerms: AddressTerm[]): GetPlaceAutocompleteTermsResult {
      const fieldsToExtract: GetPlaceAutocompleteTermsResultKey[] = ['country', 'state', 'city', 'street'];
      const result: GetPlaceAutocompleteTermsResult = {};
      fieldsToExtract.forEach((fieldToExtract, index) => {
      const fieldTermIndex = addressTerms.length - (index + 1);
      result[fieldToExtract] = fieldTermIndex >= 0 ? addressTerms.at(fieldTermIndex)?.value : '';
      });
      return result;
      }
    • Then we would need to extract the street and streetNumber from getPlaceAutocompleteTerms, we will name them streetFallback & streetNumberFallback.
      const {
      country: countryFallbackLongName = '',
      state: stateAutoCompleteFallback = '',
      city: cityAutocompleteFallback = '',
      } = GooglePlacesUtils.getPlaceAutocompleteTerms(autocompleteData?.terms ?? []);
    • Finally, we will use || operator to add streetFallback & streetNumberFallback as fallback value.
      const values = {
      street: `${streetNumber} ${streetName}`.trim(),

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?


    NA

    What alternative solutions did you explore? (Optional)

    Result

    Monosnap.screencast.2025-01-16.10-01-58.mp4
  5. github-actions commented on Jan 16, 2025

    @github-actions
    Contributor

    ⚠️ @Krishna2323 Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

  6. ishakakkad commented on Jan 16, 2025

    @ishakakkad
    Contributor

    Proposal

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

    Street doesn't get automatically filled out for a specific address.

    What is the root cause of that problem?

    We are using street_number and route from details?.address_components, but in some of the case street_number and route does not exist because of the input value set to empty and validation error throws.

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

    To fix issue we can we can make below changes.

    1. As per @Krishna2323's suggestion, we can modify the code in the following location:

    Return street and streetNumber from here

    type GetPlaceAutocompleteTermsResultKey = 'country' | 'state' | 'city' | 'street';
    type GetPlaceAutocompleteTermsResult = Partial<Record<GetPlaceAutocompleteTermsResultKey, string>>;
    /**
    * Finds an address term by type, and returns the value associated to key. Note that each term in the address must
    * conform to the following ORDER: <street, city, state, country>
    */
    function getPlaceAutocompleteTerms(addressTerms: AddressTerm[]): GetPlaceAutocompleteTermsResult {
    const fieldsToExtract: GetPlaceAutocompleteTermsResultKey[] = ['country', 'state', 'city', 'street'];
    const result: GetPlaceAutocompleteTermsResult = {};
    fieldsToExtract.forEach((fieldToExtract, index) => {
    const fieldTermIndex = addressTerms.length - (index + 1);
    result[fieldToExtract] = fieldTermIndex >= 0 ? addressTerms.at(fieldTermIndex)?.value : '';
    });
    return result;
    }
    and use this as a fallback values here
    street: `${streetNumber} ${streetName}`.trim(),

    However, it is important to note that in some edge cases, the street and streetNumber from getPlaceAutocompleteTerms may not return the necessary data.

    1. To handle edge cases where street and streetNumber from getPlaceAutocompleteTerms do not return data, we should implement an additional check at the following location https://github.com/Expensify/App/blob/main/src/components/AddressSearch/index.tsx#L224 as suggested by @mohit6789 . The reason for this is that structured_formatting?.main_text is selected dropdown display text and can serve as a reliable fallback.
    if (!values.street && autocompleteData?.structured_formatting?.main_text) {
        values.street = autocompleteData?.structured_formatting?.main_text;
    }
    

    Note: While this proposal may seem similar to the suggestions from @mohit6789 and @Krishna2323, it is still worth mentioning as a necessary addition.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    NA

    What alternative solutions did you explore? (Optional)

  7. melvin-bot commented on Jan 21, 2025

    @melvin-bot

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

  8. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 22, 2025
  9. changed the title [-]Workflows - Street doesn't get automatically filled out for a specific address[/-] [+][$250] Workflows - Street doesn't get automatically filled out for a specific address[/+] on Jan 22, 2025
  10. melvin-bot commented on Jan 22, 2025

    @melvin-bot
  11. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 22, 2025
  12. 26 remaining items

  13. melvin-bot commented on Feb 6, 2025

    @melvin-bot

    @mananjadhav @CortneyOfstad @mananjadhav The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  14. CortneyOfstad commented on Feb 11, 2025

    @CortneyOfstad
    Contributor

    @mananjadhav please complete the checklist as soon as you can to avoid any delay in payment. Thank you!

  15. mananjadhav commented on Feb 11, 2025

    @mananjadhav
    Collaborator

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] 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.

      It's an edge case where we haven't added the fallback for street number. So no specific offending PR.
      Link to comment: NA

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: NA

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal Template

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    @CortneyOfstad I think there should be an existing test for this behavior, but I've added one anyway. Feel free to discard if it already exists.

    Regression Test Proposal

    Test:

    1. Go to Settings > Profile > Address
    2. Type "1132" on street address
    3. Click on "1132 Murphy Ridge Rd" from the options.
    4. Verify street address gets filled out automatically.

    Do we agree 👍 or 👎

  16. melvin-bot commented on Feb 12, 2025

    @melvin-bot

    @mananjadhav @mjasikowski @CortneyOfstad @Krishna2323 this issue is now 4 weeks old, please consider:

    • Finding a contributor to fix the bug
    • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
    • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

    Thanks!

  17. CortneyOfstad commented on Feb 13, 2025

    @CortneyOfstad
    Contributor

    I confirmed there is already a test for this, so we can disregard — thanks @mananjadhav!

  18. CortneyOfstad commented on Feb 13, 2025

    @CortneyOfstad
    Contributor

    Payment Summary

    @mananjadhav — to be paid $250 via NewDot
    @Krishna2323 — paid $250 via Upwork

    Thanks all!

  19. garrettmknight commented on Feb 19, 2025

    @garrettmknight
    Contributor

    $250 approved for @mananjadhav

  20. changed the title [-][Due for payment 2025-02-13] [$250] Workflows - Street doesn't get automatically filled out for a specific address[/-] [+][Due for payment 2025-05-22] [Due for payment 2025-02-13] [$250] Workflows - Street doesn't get automatically filled out for a specific address[/+] on May 15, 2025
  21. melvin-bot commented on May 15, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.45-21 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 2025-05-22. 🎊

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

  22. melvin-bot commented on May 15, 2025

    @melvin-bot

    @mananjadhav @CortneyOfstad @mananjadhav The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

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.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions