Shorter rate limit in the same header replaces a longer one

Open Beginner friendly
#3,211 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
ruby
Domain
api, backend

Research direction

Read lib/sentry/transport/http_transport.rb around parse_rate_limit_header (the linked lines 158–165) and check the rate-limiting spec cited in the issue. Reproduce the behavior with 3600:error:organization, 0:error:project; done means the longer limit is retained for the shared category and a regression test covers the case.

Written by the indexing model from the issue text.

Description

Bug Ruby

handle_rate_limited_response keeps the longer limit across responses. Within one X-Sentry-Rate-Limits header, parse_rate_limit_header keeps the last group for each category (http_transport.rb#L158-L165). With 3600:error:organization, 0:error:project, errors are not limited, and the SDK starts sending them before the longer quota expires.

  • The spec says: "Always keep the maximum rate limit if multiple rate limits reference the same category."

@itsrayeedscodespace reported this bug in the Rust SDK in getsentry/sentry-rust#1409. A check of the other SDKs found the same behavior here.

via @szokeasaurusrex.

--

View Session [Sentry]

Dominant language
Ruby
Stars
990
Forks
552
Avg merge
2d 16h
Merged PRs (30d)
29

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/sentry-ruby

All issues in getsentry/sentry-ruby

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.