Skip to content

Gracefully handle upstream fetch failures for release lists and diffs #420

Description

@kelset

Summary

While doing a maintenance pass on the repo and triaging #411, I found that the original outage is no longer reproducible, but the investigation surfaced a real resilience gap in the app.

Today the UI assumes upstream GitHub fetches succeed and return valid content. When they do not (for example due to a transient GitHub/raw outage, a 404/429 response, or some other unexpected payload), the app can blank-screen, throw semver errors, or fail without a clear recovery path.

Concrete problem areas

src/hooks/fetch-release-versions.ts

  • fetches RELEASES from upstream
  • does not check response.ok
  • blindly parses response.text().split('\n')

src/components/common/VersionSelector.tsx

  • assumes fetched release entries are valid semver values
  • can throw if upstream returns unexpected content such as 404: Not Found
  • one example reported in Site not working as expected #411 was Invalid Version: 404: Not Found

src/hooks/fetch-diff.ts

  • fetches the diff file from upstream
  • does not check response.ok
  • passes the response body directly to parseDiff(...)
  • does not surface a user-visible error state when the request fails

Desired behavior

  • Guard upstream fetches with response.ok
  • Handle network failures and rejected fetches explicitly
  • Validate upstream release payloads before running semver operations
  • Show a user-visible error state instead of blank-screening or failing silently
  • Keep the page usable so users can change versions and retry
  • Where useful, distinguish between:
    • upstream/network failure
    • selected diff not existing upstream
    • invalid/unexpected upstream payload

Validation ideas

  • Add tests for failed RELEASES fetches
  • Add tests for invalid release payloads
  • Add tests for failed diff fetches
  • Verify the app no longer throws or blank-screens when upstream returns an error body

Context

This is split out from #411 so that the mixed outage report there can be closed and any remaining actionable work can be tracked in a more focused issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions