Fix Elixir 1.20 warnings#377
Merged
Merged
Conversation
whatyouhide
commented
Jun 30, 2026
| defp maybe_rate_limit_and_buffer_messages(state, messages) do | ||
| if state.rate_limiting && messages != [] do | ||
| state = update_in(state.rate_limiting.message_buffer, &enqueue_batch(&1, messages)) | ||
| state = update_in(state.rate_limiting.message_buffer, &:queue.in(messages, &1)) |
Collaborator
Author
There was a problem hiding this comment.
I personally prefer to remove the helper function altogether since this is the only call site and the direct call is pretty straightforward. We check that the messages are not empty right on the line above this one, so the compiler was right obviously.
| @@ -1,2 +1 @@ | |||
| ExUnit.start(capture_log: true, assert_receive_timeout: 2000) | |||
| Logger.remove_backend(:console) | |||
Collaborator
Author
There was a problem hiding this comment.
Removing this doesn't change any test output when running on later Elixir versions, so I think we should be okay with just getting rid of this.
josevalim
reviewed
Jun 30, 2026
| def labels_supported?, do: false | ||
| # We don't use just "true" because callers would likely get type warnings, | ||
| # so we trick the compiler into this being dynamic. | ||
| def labels_supported?, do: :rand.uniform() > 1.1 |
Contributor
There was a problem hiding this comment.
This is good but maybe we just bump to a more recent OTP version?
Collaborator
Author
There was a problem hiding this comment.
We're on Elixir 1.7 here (😄) so I didn't wanna touch that but yeah I'd be ok to do that (in a follow-up PR?).
josevalim
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.