Skip to content

Commit

Permalink
fix(replay): Debounced flushes not respecting maxWait (#7207)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
billyvg authored Feb 16, 2023
1 parent 1cf8988 commit b66559f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/replay/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export const MAX_SESSION_LIFE = 3_600_000; // 60 minutes

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

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

0 comments on commit b66559f

Please sign in to comment.