Skip to content

Conversation

@solnic
Copy link
Collaborator

@solnic solnic commented Jan 16, 2026

Address #967 (comment)

#skip-changelog

@solnic solnic requested a review from sl0thentr0py January 16, 2026 12:38
# Optional dependencies
{:hackney, "~> 1.8", optional: true},
{:finch, "~> 0.19.0"},
{:finch, "~> 0.19.0", optional: true},
Copy link

Choose a reason for hiding this comment

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

Bug: Making :finch optional without changing the default HTTP client from Sentry.FinchClient will cause a startup crash for users who don't have :finch installed.
Severity: CRITICAL

Suggested Fix

To avoid this breaking change, either change the default HTTP client to one that doesn't depend on :finch, or add logic to the configuration validation to select a different default client if :finch is not available. Alternatively, revert making :finch optional or treat this as a major version bump with clear documentation about the new requirement.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: mix.exs#L104

Potential issue: The default HTTP client is set to `Sentry.FinchClient`. The application
startup logic checks if this client module is loaded and has a `child_spec/0` function.
Since `Sentry.FinchClient` is part of the `:sentry` application, these checks pass even
if the `:finch` library isn't installed. The code then proceeds to call
`Sentry.FinchClient.child_spec/0`, which explicitly raises an error if `:finch` is not
available. This results in an unhandled exception that crashes the entire application on
startup for any user who updates to this version and does not have `:finch` in their
dependencies.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's fine. It's documented that you have to install finch yourself (by adding it as a dep).

@solnic solnic merged commit f20b400 into master Jan 16, 2026
12 checks passed
@solnic solnic deleted the solnic/make-finch-optional branch January 16, 2026 12:43
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.

3 participants