"File and Pay" submission fails with unhandled backend whitespace error on New Director address fields
- Dominant language
- JavaScript
- Stars
- 23
- Forks
- 62
- Avg merge
- 24m
- Merged PRs (30d)
- 1
Description
On TEST ENV : https://test.business.bcregistry.gov.bc.ca/BC0754984/standalone-directors?accountid=3041&businessid=BC0754984&filingId=0
**Note** : Found this issue specific to this business
**Link bug to the User Story**
**Description**
:
When a user attempts to add a new Director and inadvertently includes leading or trailing whitespaces in the street address fields, the frontend does not trim the input or catch the validation error. The "File and Pay" button enables as expected, but clicking it results in an unhandled API backend third-party service error blocking the submission.
**Chance of Occurring (high/medium/low/very low)**
**Pre Conditions: which Env, any pre-requesites or assumptions to execute steps?**
**Steps to Reproduce**
Navigate to the applicable Change of Directors / Add Director flow.
Proceed to add a New Director (DIR).
Complete all required fields.
In the mailingAddress and deliveryAddress input fields, enter a street address that includes a leading or trailing whitespace.
Note that front-end validation passes and the "File and Pay" button becomes enabled.
Click the "File and Pay" button.
Expected Result:
Ideal: Automatically sanitize/trim leading and trailing whitespaces from the input fields before sending the payload to the backend.
Alternative: Display a clear front-end validation error on the specific address fields prompting the user to remove the whitespace before the "File and Pay" button is enabled.
**Actual/ observed behavior/ results**
The user is blocked from filing and is presented with a raw backend/third-party service error.

```
{
"errorMessage": "API backend third party service error.",
"rootCause": {
"errors": [
{
"error": "streetAddress cannot start or end with whitespace.",
"path": "/filing/changeOfDirectors/directors/2/mailingAddress/streetAddress"
},
{
"error": "streetAddress cannot start or end with whitespace.",
"path": "/filing/changeOfDirectors/directors/2/deliveryAddress/streetAddress"
}
]
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.