Skip to content

Commit e1d8815

Browse files
committed
use correct rate limit category
1 parent c3bebf6 commit e1d8815

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
@@ -997,7 +997,7 @@ export class ReplayContainer implements ReplayContainerInterface {
997997
// TODO (v8): we can remove this guard once transport.end's type signature doesn't include void anymore
998998
if (response) {
999999
this._rateLimits = updateRateLimits(this._rateLimits, response);
1000-
if (isRateLimited(this._rateLimits, 'replay_event') || isRateLimited(this._rateLimits, 'replay_recording')) {
1000+
if (isRateLimited(this._rateLimits, 'replay')) {
10011001
this._handleRateLimit();
10021002
}
10031003
}
@@ -1086,11 +1086,7 @@ export class ReplayContainer implements ReplayContainerInterface {
10861086
* Pauses the replay and resumes it after the rate-limit duration is over.
10871087
*/
10881088
private _handleRateLimit(): void {
1089-
const rateLimitEnd = Math.max(
1090-
disabledUntil(this._rateLimits, 'replay_event'),
1091-
disabledUntil(this._rateLimits, 'replay_recording'),
1092-
);
1093-
1089+
const rateLimitEnd = disabledUntil(this._rateLimits, 'replay');
10941090
const rateLimitDuration = rateLimitEnd - Date.now();
10951091

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