Skip to content

fix: elixir-tools fails to load when latest version check fails #151

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

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

dkarter
Copy link
Contributor

@dkarter dkarter commented Aug 1, 2023

Motivation

elixir-tools.nvim fails to start if the latest version check fails with a non-200 status code (which happens in cases of a rate limit being reached)

For full description see #150

For additional context this was happening to me when I was on a VPN. Since the unauthenticated rate limit relies on IP address, and there are many users on that server, I hit the limit of 60 reqs per hour. This can also happen to someone tweaking their config and re-opening NeoVim a bunch of times.

Changes

This PR does two things:

  • use the --fail switch in the curl command that checks the latest version.
    This makes the command return a non-zero status if the response status is not
    2xx.
  • change the message so that it includes a note about a potential failure of the
    version check command due to the GitHub unauthenticated rate limit.

With these changes, elixir-tools is usable again, even if the rate limit call returns a non-2xx status code, as long as the user has a version of ElixirLS cached.

Demo

With elixir-tools cache (no notifications and elixir-tools functions correctly):

CleanShot.2023-07-31.at.21.21.23.mp4

With no elixir-tools cache:

CleanShot.2023-07-31.at.21.27.11.mp4

@dkarter dkarter marked this pull request as ready for review August 1, 2023 02:43
@mhanberg mhanberg enabled auto-merge (squash) August 1, 2023 03:11
@mhanberg
Copy link
Collaborator

mhanberg commented Aug 1, 2023

The mac test runners are having a hard time tonight. Will test locally in the morning.

@mhanberg mhanberg merged commit de6d046 into elixir-tools:main Aug 1, 2023
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