department-of-veterans-affairs / va-mobile-app

"If VA were a company, it would have a flagship mobile app."
https://department-of-veterans-affairs.github.io/va-mobile-app/
17 stars 2 forks source link

BUG - sev-2 - (iOS or All) - Contact Info - saving some (valid?) non-US addresses is currently broken #4597

Closed TKDickson closed 1 year ago

TKDickson commented 1 year ago

What happened?

Attempting to save a valid non-US address, like:

Crocus Hill 2640 The Valley 6W8M+32Q Anguilla

Is currently broken in the app. The v0/user/addresses/validate call seems to go through (this is the return):

{ "data": [{ "id": "73545f3f-611e-4c0c-829b-072a8906db3f", "type": "suggested_address", "attributes": { "addressLine1": "Crocus Hill 2640", "addressLine2": null, "addressLine3": null, "addressPou": "RESIDENCE/CHOICE", "addressType": "INTERNATIONAL", "city": "The Valley", "countryCodeIso3": "AIA", "internationalPostalCode": null, "province": null, "stateCode": null, "zipCode": null, "zipCodeSuffix": null }, "meta": { "address": { "confidenceScore": 100.0, "addressType": "International" }, "validationKey": -1377722392 } }] }

But the user experience is to be stuck on the 'saving your address' screen forever, and this call:

https://staging-api.va.gov/mobile/v0/user/addresses?addressLine1=Crocus%20Hill%202640&addressLine2=null&addressLine3=null&addressPou=RESIDENCE%2FCHOICE&addressType=INTERNATIONAL&city=The%20Valley&countryCodeIso3=AIA&internationalPostalCode=null&province=null&stateCode=null&zipCode=null&zipCodeSuffix=null&id=376473&addressMetaData=%5Bobject%20Object%5D

Never resolves - and none of the errors listed in it make sense for either the data entered, or the international address (here's the content):

{ "errors": [{ "title": "State code is too long (maximum is 2 characters)", "detail": "state-code - is too long (maximum is 2 characters)", "code": "100", "source": { "pointer": "data/attributes/state-code" }, "status": "422" }, { "title": "Zip code suffix is invalid", "detail": "zip-code-suffix - is invalid", "code": "100", "source": { "pointer": "data/attributes/zip-code-suffix" }, "status": "422" }, { "title": "State code must be blank", "detail": "state-code - must be blank", "code": "100", "source": { "pointer": "data/attributes/state-code" }, "status": "422" }, { "title": "Zip code must be blank", "detail": "zip-code - must be blank", "code": "100", "source": { "pointer": "data/attributes/zip-code" }, "status": "422" }, { "title": "Zip code suffix must be blank", "detail": "zip-code-suffix - must be blank", "code": "100", "source": { "pointer": "data/attributes/zip-code-suffix" }, "status": "422" }] }

To make things more confusing, I was able to save this completely made up & incorrect international address: Tugboat This city, Province please, 78knv8i Algeria

....because it had province populated? Mayyyybe?

Specs:

Steps to Reproduce

Profile > Personal & Contact Info > [some address] > attempt to save the address above

-OR-

Letters > Mailing Address > attempt to save the address above

Desired behavior

Valid international addresses should save correctly

Acceptance Criteria

Bug Severity - BE SURE TO ADD THE SEVERITY LABEL

See [Issue Tracking](https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/products/va-mobile-app/testing/VA%20Mobile%20App%20Test%20Plan.md#issue-tracking) for details on Severity Levels

Linked to Story

Screen shot(s) and additional information

This is the page that never resolves, for the veteran: image.png

Ticket Checklist

Sparowhawk commented 1 year ago

@TKDickson So just looking at the feedback here on the response and what you sent up. I noticed this part in the call internationalPostalCode=null

So I believe the issue is actually the + sign, doing some further testing to see if that is the issue

TKDickson commented 1 year ago

Eagle eyes! If that ends up being the case, I'll note that previously we were able to save international postal codes with + in them previously (the latest recorded-with-proof instance of this I can find is from July 2022) but of course that's a pretty giant window of time between then and now when it could have been broken.

Sparowhawk commented 1 year ago

@TKDickson it is not caused by the + sign as I was able to save the address with just changing the country to Algeria. I have tried several addresses for Anguilla and none of them works. Also to note the postal card format for Anguila is Persons Name/facility name unit Locality/District(The Valley) Postcode(AI-2640) Country

Sparowhawk commented 1 year ago

So the issue I have narrowed down to is Anguilla itself and specifically a back end issue

kellylein commented 1 year ago

Closing as a duplicate of #4635

aherzberg commented 1 year ago

I believe this should be reopened as a FE issue, see comments on https://app.zenhub.com/workspaces/va-mobile---backend-61d75d03a7505500147ec7f6/issues/gh/department-of-veterans-affairs/va-mobile-app/4635. Happy to pair with you on this @Sparowhawk