Skip to content

Stop forwarding rate-limited checkin activities upstream#53

Merged
feruzm merged 1 commit into
mainfrom
fix/usr-activity-early-return
Jul 12, 2026
Merged

Stop forwarding rate-limited checkin activities upstream#53
feruzm merged 1 commit into
mainfrom
fix/usr-activity-early-return

Conversation

@feruzm

@feruzm feruzm commented Jul 12, 2026

Copy link
Copy Markdown
Member

The ty === 10 rate-limit branch in the activities handler acks repeat visits (same IP within 15 minutes) with an early 201, but was missing a return — a bug inherited from the Node implementation. The duplicate checkin event was therefore still POSTed to the private API on every rate-limited hit, defeating the branch's purpose, and pipe() logged headers already sent each time (path-attributed diagnostics from #52 show this is the only source of that warning in production, thousands of occurrences per day).

The fix short-circuits after sending the 201 and refreshing the sliding cache window, exactly as the branch always intended. First-seen requests and requests outside the 15-minute window are unchanged and still forward upstream. Deliberate behavior change: upstream stops receiving the duplicate events (which its own per-activity accounting rules should already have been discarding).

The ty=10 rate-limit branch acked repeat visits (same IP within 15 min) with
an early 201 but was missing a return — inherited from the Node code — so the
duplicate event was still POSTed to the private API on every rate-limited hit,
and pipe logged 'headers already sent' each time (the only source of that
warning in production). Short-circuit after refreshing the sliding window, as
the branch always intended. First-seen and stale-window requests are unchanged.
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@feruzm, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fc5493ec-fafb-4d76-8357-34d5328a5762

📥 Commits

Reviewing files that changed from the base of the PR and between 2965154 and 33d2a45.

📒 Files selected for processing (1)
  • dotnet/EcencyApi/Handlers/PrivateApi.Misc.cs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/usr-activity-early-return

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 12, 2026

Copy link
Copy Markdown

Greptile Summary

This PR stops duplicate rate-limited checkins from being forwarded upstream.

  • Adds a withinWindow boolean for the 15-minute repeat-checkin test.
  • Sends the existing 201 response for repeat checkins.
  • Refreshes the sliding cache window before returning early.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • The early return only applies after the repeat-checkin response and cache refresh attempt.
  • First-seen and expired-window checkins still use the existing upstream forwarding path.

Important Files Changed

Filename Overview
dotnet/EcencyApi/Handlers/PrivateApi.Misc.cs Updates the repeat-checkin rate-limit path to return after acknowledging and refreshing the cache window.

Reviews (1): Last reviewed commit: "fix: stop forwarding rate-limited checki..." | Re-trigger Greptile

@feruzm feruzm merged commit 1b94ce5 into main Jul 12, 2026
5 checks passed
@feruzm feruzm deleted the fix/usr-activity-early-return branch July 12, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant