Skip to content

Handle malformed redirect data in some versions #1110

@Mr0grog

Description

@Mr0grog

I ran across an old Versionista version today that has malformed redirect data (https://api.monitoring.envirodatagov.org/api/v0/versions/69ff9ffe-0482-49fc-b5f6-f3d3b9906dcd), it turns out that breaks the UI. See this comparison view for an example: https://monitoring.envirodatagov.org/page/447f59e4-1bf8-4c63-918e-43030acc59b6/69ff9ffe-0482-49fc-b5f6-f3d3b9906dcd..cd686ddd-05ba-4b94-ac96-b878e5e65383

The problem here is that this version has bad data in its redirect history:

{
    "uuid": "69ff9ffe-0482-49fc-b5f6-f3d3b9906dcd",
    "source_metadata": {
        "redirects": [
            "2016-01-01T00:00:00.000Z"
        ],
        // ...
    },
    // ...
}

The PageUrlDetails component sees that there are redirects and attempts to show a list of them with UrlHistoryList, which errors when it calls parseUrlForDiff() on the invalid URL.

We should probably validate that the history is actually a list of URLs first and either only show it if all the entries are valid or just filter out the invalid entries. Either is probably OK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions