Repository navigation
Merge upstream master into the fork - #8
Merged
Merged
Conversation
ActiveSupport passes quirks_mode to JSON.generate and JSON.parse. json 3 made unknown options an ArgumentError, so Sunspot.remove_all! in spec_helper blows up and every sunspot_rails spec fails with it. Rails 8 dropped quirks_mode, but the Appraisals file stops at Rails 7.0, so nothing in the matrix can run on json 3. Pinning it as a development dependency, next to the psych pin that is already there for the same kind of reason.
The quirks_mode incompatibility depends on the Rails version, so pin json next to the other version-specific gems instead of in the gemspec, and correct the comment: 8.0.x still passes quirks_mode; only 7.2.4+ and 8.1+ don't.
Pin `json` below 3 for the sunspot_rails suite
ContextBoundDelegate tries the receiver first and falls back to the calling context in a rescue, so every DSL call that belongs to the calling context raises a NoMethodError whose backtrace is then thrown away. Raising captures the whole stack at roughly 3 objects per frame, and a Rails request is already ~182 frames deep inside a search block, so each raise costs ~600 objects. In our app a block calling a few model helpers raised 70 times per request; dropping those took the request from 288,801 to 246,807 objects allocated, 14.6% less. The fast path uses respond_to? to dispatch straight to the calling context. Where respond_to? can't answer, method_missing without respond_to_missing? being the obvious case, it falls through to the old path.
The respond_to? fast path let the calling context win over receivers
that handle calls in method_missing without respond_to_missing?, such
as DSL::Function (function { sum(...) } in a model class method) and
DSL::Fields (double inside an RSpec example). It also called
respond_to? on BasicObject receivers that don't have it.
Only take the fast path when the receiver has Kernel, doesn't respond
to the method and uses the default method_missing, so it could only
have raised. Add specs for each case, and only count raises on the
test thread.
…or-in-dsl-dispatch Avoid NoMethodError when resolving DSL calls
Brings in sunspot#1057, which avoids a `NoMethodError` when the DSL resolves a call against a receiver, and sunspot#1058, which pins `json` below 3 in the `sunspot_rails` appraisals, ahead of an upstream gem release. Upstream's json pin supersedes the fork's own from #5, which pinned only the Rails 6.1 and 7.0 appraisals, so the fork's line is dropped and `sunspot_rails/Appraisals` now equals upstream's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TAYgm5SknHTiRNTgGA6LBY
This was referenced Oct 21, 2026
njakobsen
marked this pull request as ready for review
October 21, 2026 16:45
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.
Summary
Brings the fork's
masterup to upstreammaster(59e1ef0f), ahead of an upstream gem release, so the fork's users run upstream's latest code before it ships.NoMethodErrorwhen the DSL resolves a call against a receiver, and keeps receiver-first dispatch for receivers withmethod_missing.jsonbelow 3 for the sunspot_rails suite sunspot/sunspot#1058: pinsjsonbelow 3 in thesunspot_railsappraisals. It supersedes the fork's own pin from Merge upstream master into the fork, and keep json below 3 for old Rails #5, which covered only the Rails 6.1 and 7.0 appraisals, so the merge drops the fork's line andsunspot_rails/Appraisalsequals upstream's.The merge had no conflicts. Apart from the dropped line, the tree differs from upstream's only by the fork's nested documents work (#4).
#6 and #7 have this merged in, so stolo_connect and Glint run upstream's changes through them.
Test plan
sunspotintegration specs in both update formats, 408 examples, 0 failures. The API specs have the same 12 local-only failures asmaster.sunspotintegration specs pass on Solr 9.10.1 and 5.3.1, andsunspot_rails(Rails 7.0) passes on both.culturecodesuite, andreferral_search_spec.rbandreferral_spec.rbon all 31 clients, 0 failures.🤖 Generated with Claude Code
https://claude.ai/code/session_01TAYgm5SknHTiRNTgGA6LBY