#1671: fix fragile e.name == :get heuristic in qosearch rate limit check#1780
Open
VasilevNStas wants to merge 5 commits into
Open
#1671: fix fragile e.name == :get heuristic in qosearch rate limit check#1780VasilevNStas wants to merge 5 commits into
VasilevNStas wants to merge 5 commits into
Conversation
Contributor
Author
|
@yegor256 plz review |
yegor256
reviewed
Jul 13, 2026
| raise unless e.name == :get | ||
| left = octo.rate_limit.remaining | ||
| rescue StandardError => e | ||
| $loog.info("Can't fetch /rate_limit: #{e.message}") |
…store NoMethodError rescue
VasilevNStas
force-pushed
the
1671-fragile-heuristic
branch
from
July 13, 2026 20:14
2d9e905 to
af5471a
Compare
Contributor
Author
|
@yegor256 plz review this |
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.
Closes #1671
Fix fragile
NoMethodErrorheuristic for detecting:getmethod availability inJp.qosearch.The original code used
rescue NoMethodError => e; raise unless e.name == :get— fragile because proxy wrappers (decoor, intercepted) makerespond_to?(:get)unreliable (returns true even when the underlying object lacks:get).Changes:
rescue NoMethodError => e; raise unless e.name == :getfor the:getfallback path (works correctly with proxy wrappers)rescue StandardErrorfor network/WebMock errors so they don't crash the judgeget('/rate_limit')succeeds butresources.search.remainingis missing →left = nil→ search is skipped (quota unavailable):getis unavailable → fall back toocto.rate_limit.remaining(core rate limit)