edgi-govdata-archiving / web-monitoring-ui

UI to enable analysts to quickly assess changes to monitored government websites
GNU General Public License v3.0
37 stars 38 forks source link

Some comparison views render nothing #1038

Closed Mr0grog closed 1 year ago

Mr0grog commented 1 year ago

Some comparison views blank out and render nothing for certain versions. For example: https://monitoring-staging.envirodatagov.org/page/a1978226-4ef3-4732-b554-bac5caeab175/c2159057-1af5-4a0e-992c-43b8dfcb03f0..abf0e00d-4431-448b-bf6c-e1601afa0ff2

It looks like this is because we have a handful of bad versions in the system with null URLs and we are making some assumptions that a URL will be there. I’m seeing exceptions like this in the console:

TypeError: URL constructor: null is not a valid URL.
    r html-transforms.js:196
    fl html-transforms.js:206
    cl html-transforms.js:142
    cl html-transforms.js:141
    al html-transforms.js:23
    al html-transforms.js:22
    e sandboxed-html.jsx:43
    e sandboxed-html.jsx:64
    _updateContent sandboxed-html.jsx:66
    componentDidMount sandboxed-html.jsx:25
    React 2
    unstable_runWithPriority scheduler.production.min.js:19
    React 4
    unstable_runWithPriority scheduler.production.min.js:19
    React 6
    _loadDiffData diff-view.jsx:227

I recall having some old Versionista records where the relevant data had already expired (so we had the current URL of the page, but not what it actually captured), and that is probably the source of the problematic data.

A good solution here might be to just use the page’s URL as a fallback.

Mr0grog commented 1 year ago

Yowza, we have 2,125 in staging, but none (?!) in production. I guess I found a way to repair them in production at some point, and that never made it back to staging.