Skip to content

fix(services/version): prevent checkForUpdate() 5xx response codes from stopping connection #388

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

Conversation

crookse
Copy link
Contributor

@crookse crookse commented Oct 30, 2024

I was receiving this error earlier today and couldn't connect to my process:

Screenshot 2024-10-30 at 11 23 55

I found the issue was around the response code returned from fetching from UPDATE_URL (value is https://get_ao.g8way.io) for an update. The response code was 502.

Although this PR doesn't address every edge case, it addresses the one I experienced earlier today. This PR introduces the following:

  • Returns { available: false } if fetching from update URL returns a 5xx status code
  • Adds tests to ensure 404 and 5xx status codes return { available: false }
  • When process.env.DEBUG is truthy, a warning message will be shown for fetches that result in 5xx status codes. For example:
    Screenshot 2024-10-30 at 11 30 40

Copy link
Collaborator

@twilson63 twilson63 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@twilson63 twilson63 merged commit 242b455 into permaweb:main Nov 14, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants