Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ defmodule Sentry.Mixfile do

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

{:jason, "~> 1.1", optional: true},
{:phoenix, "~> 1.6", optional: true},
{:phoenix_live_view, "~> 0.20 or ~> 1.0", optional: true},
Expand Down
Loading