Skip to content

Fix Elixir 1.20 warnings#377

Merged
whatyouhide merged 1 commit into
mainfrom
al/warnings
Jun 30, 2026
Merged

Fix Elixir 1.20 warnings#377
whatyouhide merged 1 commit into
mainfrom
al/warnings

Conversation

@whatyouhide

Copy link
Copy Markdown
Collaborator

No description provided.

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

Comment thread test/test_helper.exs
@@ -1,2 +1 @@
ExUnit.start(capture_log: true, assert_receive_timeout: 2000)
Logger.remove_backend(:console)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@whatyouhide whatyouhide requested a review from josevalim June 30, 2026 07:17
Comment thread lib/broadway/process.ex
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is good but maybe we just bump to a more recent OTP version?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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?).

@whatyouhide whatyouhide merged commit 04239b4 into main Jun 30, 2026
2 checks passed
@whatyouhide whatyouhide deleted the al/warnings branch June 30, 2026 17:06
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