Skip to content

Commit f4b3567

Browse files
committed
use correct rate limit category
1 parent 45d335b commit f4b3567

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
@@ -1000,7 +1000,7 @@ export class ReplayContainer implements ReplayContainerInterface {
10001000
// TODO (v8): we can remove this guard once transport.end's type signature doesn't include void anymore
10011001
if (response) {
10021002
this._rateLimits = updateRateLimits(this._rateLimits, response);
1003-
if (isRateLimited(this._rateLimits, 'replay_event') || isRateLimited(this._rateLimits, 'replay_recording')) {
1003+
if (isRateLimited(this._rateLimits, 'replay')) {
10041004
this._handleRateLimit();
10051005
}
10061006
}
@@ -1089,11 +1089,7 @@ export class ReplayContainer implements ReplayContainerInterface {
10891089
* Pauses the replay and resumes it after the rate-limit duration is over.
10901090
*/
10911091
private _handleRateLimit(): void {
1092-
const rateLimitEnd = Math.max(
1093-
disabledUntil(this._rateLimits, 'replay_event'),
1094-
disabledUntil(this._rateLimits, 'replay_recording'),
1095-
);
1096-
1092+
const rateLimitEnd = disabledUntil(this._rateLimits, 'replay');
10971093
const rateLimitDuration = rateLimitEnd - Date.now();
10981094

10991095
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)