Skip to content

Conversation

@pierre-lehnen-rc
Copy link
Contributor

@pierre-lehnen-rc pierre-lehnen-rc commented Jun 26, 2025

Proposed changes (including videos or screenshots)

This PR fixes the issue of Rate Limiter not being enforced. Rate-limit rules are defined with version prefixed paths (e.g. /v1/rooms.get), but the limiter was receiving malformed keys like /rooms.getget, so no v1 endpoints were ever rate-limited.
Since, the lookup for the current route in the rateLimiter config dictionary always failed.

  • Made getFullRouteName() a public method on APIClass.
  • Updated rate-limiter key construction to use:
    api.getFullRouteName(route, method)
    instead of manual concatenation ("/" + route + method").

Issue(s)

CORE-1236

Steps to test or reproduce

Further comments

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Jun 26, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Jun 26, 2025

🦋 Changeset detected

Latest commit: d812c90

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 36 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jun 26, 2025

PR Preview Action v1.6.2

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-36313/

Built to branch gh-pages at 2025-07-16 20:25 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov
Copy link

codecov bot commented Jun 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.52%. Comparing base (6f4429f) to head (d812c90).
Report is 5 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #36313      +/-   ##
===========================================
+ Coverage    65.50%   65.52%   +0.01%     
===========================================
  Files         3169     3169              
  Lines       105177   105187      +10     
  Branches     20029    20038       +9     
===========================================
+ Hits         68896    68920      +24     
+ Misses       33602    33591      -11     
+ Partials      2679     2676       -3     
Flag Coverage Δ
e2e 58.19% <ø> (+0.02%) ⬆️
unit 70.64% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@abhinavkrin abhinavkrin force-pushed the fix/rest-api-rate-limiter branch from 5fd2389 to 99c0b4d Compare July 11, 2025 11:19
@abhinavkrin abhinavkrin marked this pull request as ready for review July 11, 2025 11:27
@abhinavkrin abhinavkrin added this to the 7.9.0 milestone Jul 11, 2025
@abhinavkrin abhinavkrin added the stat: QA assured Means it has been tested and approved by a company insider label Jul 16, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jul 16, 2025
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Jul 16, 2025
@abhinavkrin abhinavkrin added stat: QA assured Means it has been tested and approved by a company insider and removed stat: QA assured Means it has been tested and approved by a company insider labels Jul 16, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jul 16, 2025
@kodiakhq kodiakhq bot merged commit 1693663 into develop Jul 16, 2025
44 checks passed
@kodiakhq kodiakhq bot deleted the fix/rest-api-rate-limiter branch July 16, 2025 21:09
@abhinavkrin abhinavkrin added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants