department-of-veterans-affairs / va.gov-vfs-teams

Documentation for External Contractor teams working on the Veteran-facing Services Platform
8 stars 17 forks source link

[Bug] MISSION Act - Facility locator fires multiple searches per user action #44

Closed mmiddaugh closed 4 years ago

mmiddaugh commented 4 years ago

@SimonSchama commented on Fri May 31 2019

Specs:

Steps to Reproduce url: https://va.gov/find-locations

  1. Open developer tools or some other method of tracking network traffic
  2. Type an address into the "Search city, state, or postal code" input field and click the "Search" button

What happened: Two requests to the /v0/facilities/va endpoint are made. These requests have different bounding boxes and addresses for parameters. One set of parameters will correspond to the visible map and one will not. This can lead to inconsistent results being displayed and results disappearing after a search is completed. Detailed debugging information about the react events that get fired off in this process can be found here: https://gist.github.com/r-mc2/27e309840cda3d8a37735f6c2025bf08#order-of-operations image

Desired behavior: Only one request to the facilities/va endpoint should be made, with the bbox parameters corresponding to the bounds of the visible map and the address parameter corresponding to an address that is roughly at the center of the visible map.


@Karak888 commented on Tue Jun 04 2019

Hi @ncksllvn this is one of the ones that I ask that you please review today. (this is the API one) Thanks :cc @chrisj-usds


@chrisj-usds commented on Tue Jun 04 2019

Discussed with @ncksllvn today (6/3). He will investigate this after addressing the two MISSION-related bugs that have obvious solutions.


@chrisj-usds commented on Tue Jun 11 2019

Here's a pretty extreme example I found today:

Search for Chicago, IL for Community Care with specialty type Clinic / Center - Primary Care. There is nothing in the city, so it auto-zooms out until it finds results. Then:

First it will say there are no results. A few second later it will change to 6 results. A few seconds later it will change to 10 results. A few seconds later it will change back to 6 results.


@DanielleSoCompany commented on Tue Jun 11 2019

@ncksllvn adding 500 error message here from our slack conversation, just to keep a copy of everything here:

We’re sorry. We couldn’t complete your request.

Please try again in a few minutes. Or, if you need care right away for a minor illness or injury, search for your nearest VA health facility or find VA-approved urgent care locations and pharmacies near you.

If you have a medical emergency, please go to the nearest emergency room or call 911.


@ncksllvn commented on Tue Jun 11 2019

I have a PR open for this now, https://github.com/department-of-veterans-affairs/vets-website/pull/10225.

This appears to have been introduced back when Community Cares was first rolled out behind a feature flag in this massive pull request back in October. Pull requests of that size are very difficult to review.


@ncksllvn commented on Wed Jun 12 2019

This will be live today!


@DanielleSoCompany commented on Wed Jun 12 2019

@ncksllvn, you're amazing!!