Skip to content

Commit b66559f

Browse files
authored
fix(replay): Debounced flushes not respecting maxWait (#7207)
This is happening due to a bug in the `debounce` function where it does not respect `maxWait` if its value is the same as `wait` (https://github.com/getsentry/sentry-javascript/blob/develop/packages/replay/src/util/debounce.ts#L60) . This is causing poor fidelity in Replays and possibly memory issues if it never flushes after the initial checkout. This is just a quick fix until we fix `debounce`.
1 parent 1cf8988 commit b66559f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/replay/src/constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export const MAX_SESSION_LIFE = 3_600_000; // 60 minutes
2222

2323
/** Default flush delays */
2424
export const DEFAULT_FLUSH_MIN_DELAY = 5_000;
25-
export const DEFAULT_FLUSH_MAX_DELAY = 5_000;
25+
// XXX: Temp fix for our debounce logic where `maxWait` would never occur if it
26+
// was the same as `wait`
27+
export const DEFAULT_FLUSH_MAX_DELAY = 5_500;
2628

2729
/* How long to wait for error checkouts */
2830
export const ERROR_CHECKOUT_TIME = 60_000;

0 commit comments

Comments
 (0)