Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-unique address error not displayed when selecting address from dropdown #5813

Open
paulo-rossy opened this issue Feb 19, 2025 · 3 comments
Assignees

Comments

@paulo-rossy
Copy link
Contributor

Non-unique address error not displayed when selecting address from dropdown

I'm experiencing an issue when adding a building address using the Google address provider. The system should check if the entered address already exists and display an error message if it does. However, there's a discrepancy in how the error appears depending on whether the address is selected from the dropdown list or typed manually.

Steps to Reproduce

  1. Type in an existing address without using the dropdown suggestions.

  2. Click the "Add" button.

  3. Observe the error message indicating a non-unique address (as expected).

  4. Alternatively, select the same existing address from the dropdown list.

  5. Click the "Add" button again.

  6. Notice that no error message is displayed in the UI, but the error appears in the developer console.

Expected Behavior

  • When an existing address is selected (either manually or from the dropdown), the UI should display the non-unique address error message consistently.

  • I’ve attached a video demonstrating this issue.

Thank you for looking into this!
https://github.com/user-attachments/assets/4cab2a8c-677f-4e82-a718-5961c63ffbc4

@pahaz
Copy link
Member

pahaz commented Feb 19, 2025

Hi!

Thanks for reporting this issue. I’ve looked into it and it seems that the non-unique address error does not show up consistently when selecting an address from the dropdown, which is definitely unexpected behavior.

It appears that this issue might be related to the Google address provider. When the address is typed manually, the error message is displayed correctly, but when selecting it from the dropdown, the UI doesn’t show the error, even though it appears in the console.

We believe the issue could be with how the address data is handled when selected from the Google provider’s dropdown. If you’re able to provide a fix or any suggestions on how to address this, we’d be more than happy to review and merge it.

Thanks again for bringing this up, and feel free to reach out if you need any further assistance!

@pahaz
Copy link
Member

pahaz commented Feb 19, 2025

Please also provide an API error message. It should help to understand the problem.

@paulo-rossy
Copy link
Contributor Author

Please also provide an API error message. It should help to understand the problem.

@pahaz Hello! Here it is:

{
    "errors": [
        {
            "message": "Property with the same address (id=98a3cf82-bf09-4ffc-a99e-736decad3954) already exists in current organization",
            "name": "GQLError",
            "locations": [
                {
                    "line": 2,
                    "column": 3
                }
            ],
            "path": [
                "obj"
            ],
            "extensions": {
                "code": "BAD_USER_INPUT",
                "messageForDeveloper": "Property with the same address (id=98a3cf82-bf09-4ffc-a99e-736decad3954) already exists in current organization\n\nGraphQL request:2:3\n1 | mutation createProperty($data: PropertyCreateInput) {\n2 |   obj: createProperty(data: $data) {\n  |   ^\n3 |     name",
                "query": "createProperty",
                "type": "PROPERTY_ALREADY_EXISTS",
                "message": "Property with the same address (id=98a3cf82-bf09-4ffc-a99e-736decad3954) already exists in current organization",
                "messageForUser": "Property with the same address already exists in selected organization",
                "messageInterpolation": {
                    "existingPropertyId": "98a3cf82-bf09-4ffc-a99e-736decad3954"
                },
                "messageForUserTemplateKey": "api.property.property.SAME_ADDRESS"
            }
        }
    ],
    "data": {
        "obj": null
    }
}

@toplenboren toplenboren self-assigned this Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants