Skip to content

fix: fix delegation of open? function to use the same function name #462

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
Feb 5, 2025

Conversation

sevenseacat
Copy link
Contributor

Just upgraded to Mint 1.7 and started getting errors whenever trying to use it -

** (UndefinedFunctionError) function Mint.HTTP1.open/2 is undefined or private. Did you mean:

      * open?/1
      * open?/2

    (mint 1.7.0) Mint.HTTP1.open(%Mint.HTTP1{host: "hex.pm", port: 443, request: nil, streaming_request: nil, socket: {:sslsocket, {:gen_tcp, #Port<0.148>, :tls_connection, :undefined}, [#PID<0.7456.0>, #PID<0.7455.0>]}, transport: Mint.Core.Transport.SSL, mode: :passive, scheme_as_string: "https", case_sensitive_headers: false, skip_target_validation: false, requests: {[], []}, state: :open, buffer: "", proxy_headers: [], private: %{}, log: false}, :write)
    (finch 0.19.0) lib/finch/http1/pool.ex:283: Finch.HTTP1.Pool.transfer_if_open/3
    (finch 0.19.0) lib/finch/http1/pool.ex:70: anonymous fn/10 in Finch.HTTP1.Pool.request/6
    (nimble_pool 1.1.0) lib/nimble_pool.ex:462: NimblePool.checkout!/4
    (finch 0.19.0) lib/finch/http1/pool.ex:52: Finch.HTTP1.Pool.request/6
    (finch 0.19.0) lib/finch.ex:493: anonymous fn/4 in Finch.request/3
    (telemetry 1.3.0) /Users/rebecca/Projects/book/testing/tunez_starter/deps/telemetry/src/telemetry.erl:324: :telemetry.span/3
    (req 0.5.8) lib/req/finch.ex:253: Req.Finch.run_finch_request/3

I think this is the cause!

@cheerfulstoic
Copy link

Just ran into this myself! 😅

@sneako
Copy link
Contributor

sneako commented Feb 5, 2025

We could consider adding an assert HTTP.open?(conn) after one of the HTTP.connect/4 calls in https://github.com/elixir-mint/mint/blob/main/test/mint/integration_test.exs

@whatyouhide
Copy link
Contributor

@sneako PR welcome for that test! Doing a release ASAP to not break stuff 😉

@sevenseacat sevenseacat deleted the patch-1 branch February 5, 2025 15:00
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.

None yet

4 participants