rate_limit.rb lines 47-49: track_request decrements @remaining/@searchleft BEFORE the HTTP call is made. If the HTTP call fails (network error, timeout, 401), the counter is already decremented but no actual request was consumed. The sync method only runs in on_complete, which doesn't fire on connection errors.
REPRODUCTION: Make a request that fails with a connection error; the counter is still decremented.
IMPACT: Rate limit counter becomes overly pessimistic; could trigger premature off_quota? when quota is actually still available.
rate_limit.rb lines 47-49: track_request decrements @remaining/@searchleft BEFORE the HTTP call is made. If the HTTP call fails (network error, timeout, 401), the counter is already decremented but no actual request was consumed. The sync method only runs in on_complete, which doesn't fire on connection errors.
REPRODUCTION: Make a request that fails with a connection error; the counter is still decremented.
IMPACT: Rate limit counter becomes overly pessimistic; could trigger premature off_quota? when quota is actually still available.