Skip to content

Commit 12429c8

Browse files
committed
use correct rate limit category
1 parent 3808b24 commit 12429c8

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

packages/replay/src/replay.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ export class ReplayContainer implements ReplayContainerInterface {
10041004
// TODO (v8): we can remove this guard once transport.end's type signature doesn't include void anymore
10051005
if (response) {
10061006
this._rateLimits = updateRateLimits(this._rateLimits, response);
1007-
if (isRateLimited(this._rateLimits, 'replay_event') || isRateLimited(this._rateLimits, 'replay_recording')) {
1007+
if (isRateLimited(this._rateLimits, 'replay')) {
10081008
this._handleRateLimit();
10091009
}
10101010
}
@@ -1093,11 +1093,7 @@ export class ReplayContainer implements ReplayContainerInterface {
10931093
* Pauses the replay and resumes it after the rate-limit duration is over.
10941094
*/
10951095
private _handleRateLimit(): void {
1096-
const rateLimitEnd = Math.max(
1097-
disabledUntil(this._rateLimits, 'replay_event'),
1098-
disabledUntil(this._rateLimits, 'replay_recording'),
1099-
);
1100-
1096+
const rateLimitEnd = disabledUntil(this._rateLimits, 'replay');
11011097
const rateLimitDuration = rateLimitEnd - Date.now();
11021098

11031099
if (rateLimitDuration > 0) {

packages/replay/test/integration/rateLimiting.test.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,7 @@ describe('Integration | rate-limiting behaviour', () => {
7676
{
7777
statusCode: 429,
7878
headers: {
79-
'x-sentry-rate-limits': '30:replay_event',
80-
'retry-after': null,
81-
},
82-
},
83-
{
84-
statusCode: 429,
85-
headers: {
86-
'x-sentry-rate-limits': '30:replay_recording',
79+
'x-sentry-rate-limits': '30:replay',
8780
'retry-after': null,
8881
},
8982
},

0 commit comments

Comments
 (0)