Repository navigation
Read url_helper_name and url_options from what their writers set - #108
Merged
fractaledmind merged 1 commit intoOct 16, 2026
Merged
Conversation
mattr_writer stores the value in a class variable, but the readers memoized an instance variable, so config.solid_errors.url_options and url_helper_name were silently ignored and the error email fell back to detection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
url_helper_nameandurl_optionsare declared withmattr_writer, which stores the value in a class variable (@@url_options). Their readers memoize an instance variable (@url_options ||= detect_url_options) and never look at it. So the engine'sconfig.solid_errors.each { SolidErrors.public_send("#{name}=", value) }writes a value that nothing reads, and the email falls back to route detection.That shows up as an error email with no link whenever detection can't find the route. Two common cases:
solid_errors, e.g.mount SolidErrors::Engine, at: "errors", as: "admin_errors". Detection falls back to:solid_errors,occurrence_urlraisesNoMethodError, the helper rescues it, and the link is dropped.ActionMailer'sdefault_url_options, so the link needsurl_options: {host: ...}.The fix makes the readers memoize into the same class variables the writers set. Explicit config wins, and detection still fills in when nothing is configured.
Added a mailer test that sets
url_optionsand checks the link. It fails before the change and passes after.