elixir-tools / elixir-tools.nvim

Neovim plugin for Elixir
MIT License
398 stars 29 forks source link

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

Closed dkarter closed 12 months ago

dkarter commented 12 months ago

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 https://github.com/elixir-tools/elixir-tools.nvim/issues/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:

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):

https://github.com/elixir-tools/elixir-tools.nvim/assets/551858/f2cfdd14-6570-4c34-a73c-612126a5956a

With no elixir-tools cache:

https://github.com/elixir-tools/elixir-tools.nvim/assets/551858/b1272260-ad53-494b-8e97-443cfe5639b9

mhanberg commented 12 months ago

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