Skip to content

fix(mint): avoid active-mode message races without breaking reused connections#812

Merged
yordis merged 1 commit intoelixir-tesla:masterfrom
flaviogrossi:fix_mint_unkwnown_message
Apr 18, 2026
Merged

fix(mint): avoid active-mode message races without breaking reused connections#812
yordis merged 1 commit intoelixir-tesla:masterfrom
flaviogrossi:fix_mint_unkwnown_message

Conversation

@flaviogrossi
Copy link
Copy Markdown
Contributor

this should fix #811

Reading the issue #357 and the subsequent PR, it seems that the desired fix was to set the default mint mode to passive, however it was not really set because of the reasons outlined in #811

A related change is to avoid wrapping the timeout transport error in a string when passive mode is used: currently the receive_message function returns a {:error, :timeout} error when in active mode, a mint error when in passive, which is then wrapped in a {:error, "Encounter Mint error %Mint.TransportError{reason: :timeout}"} tuple. This was changed to avoid incoherent errors between the two modes.

Please let me know if this is an acceptable way to fix the timeout return value inconsistency or it is better to leave it as it is (and instead fix the test) because it would technically introduce a breaking change in the api

Comment thread lib/tesla/adapter/mint.ex
…nnections

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis yordis force-pushed the fix_mint_unkwnown_message branch from 22882dd to 755617c Compare April 18, 2026 06:49
@yordis yordis changed the title DRAFT: change default mode for tesla adapter to passive fix(mint): avoid active-mode message races without breaking reused connections Apr 18, 2026
@yordis yordis merged commit d812f54 into elixir-tesla:master Apr 18, 2026
8 of 10 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.

Sometimes an :unknown message is returned when using the mint adapter

2 participants