-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(replay): Stop without retry when receiving bad API response #6773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -234,6 +234,7 @@ export class ReplayContainer implements ReplayContainerInterface { | |||
this._stopRecording?.(); | |||
this.eventBuffer?.destroy(); | |||
this.eventBuffer = null; | |||
this._debouncedFlush.cancel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small thing I noticed while debugging tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
@@ -907,7 +908,7 @@ export class ReplayContainer implements ReplayContainerInterface { | |||
if (rateLimitDuration > 0) { | |||
__DEBUG_BUILD__ && logger.warn('[Replay]', `Rate limit hit, pausing replay for ${rateLimitDuration}ms`); | |||
this.pause(); | |||
this._debouncedFlush && this._debouncedFlush.cancel(); | |||
this._debouncedFlush.cancel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is set in the constructor, so no need to check for existence here.
@@ -5,7 +5,7 @@ import type { DomHandler } from './../types'; | |||
import type { MockSdkParams } from './mockSdk'; | |||
import { mockSdk } from './mockSdk'; | |||
|
|||
export async function resetSdkMock({ replayOptions, sentryOptions }: MockSdkParams): Promise<{ | |||
export async function resetSdkMock({ replayOptions, sentryOptions, autoStart }: MockSdkParams): Promise<{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed that this was not actually passed through.
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I think going with an integration test is a good thing in this case.
38445f9
to
6197d34
Compare
ref #6770 as either here or there we should adjust the integration test. |
6197d34
to
7e93d4b
Compare
This is based on #6765!
This ensures that when we hit a "bad" API response, instead of continuing - which we do now, which will lead to missing segments - we stop the replay immediately.
We do not do any retries in this case, as that could lead to us e.g. hammering the API when there is a problem, which we need to avoid.
I've spent way to much time getting this to work in the "classic" test setup we have, and eventually gave up and wrote a integration test instead. For what it's worth, the problem seems to be with resetting stuff & mocks when we have multiple tests in a row (it worked when running tests one by one). It is very weird, but a problem to be solved with more time, I'd say. For now, the test should be good.