Skip to content

open non-existing schema version results in infinite loading and backend exception #7052

@n1ru4l

Description

@n1ru4l

If I visit some url like http://localhost:3000/the-guild/otel-demo/development/history/qjwghejkqwhenqwe (note the invalid UUID), the API responds with the following error. Before we query for the UUID in postgres, we need to validate the input on the business logic layer and otherwise treat this scenario as "not found".

{
    "errors": [
        {
            "message": "Unexpected error.",
            "locations": [
                {
                    "line": 12,
                    "column": 7
                }
            ],
            "path": [
                "project",
                "target",
                "schemaVersion"
            ],
            "extensions": {
                "code": "INTERNAL_SERVER_ERROR"
            }
        }
    ],
    "data": {
        "__typename": "Query",
        "project": {
            "__typename": "Project",
            "id": "7c4bcd42-32e7-4485-9f12-ce903acce4d9",
            "type": "FEDERATION",
            "target": {
                "__typename": "Target",
                "id": "219fedb6-8a9b-44d7-929f-b0b16750653c",
                "schemaVersion": null
            }
        }
    }
}

For a non existing schema version (but valid UUID) e.g. http://localhost:3000/the-guild/otel-demo/development/history/5e52d300-b223-428f-9364-f10d31595f40, we also get an infinite loading state and an exception thrown by our graphql server.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions