rollbar.js icon indicating copy to clipboard operation
rollbar.js copied to clipboard

Align `Recorder.checkoutEveryNms` default with rrweb behavior when `maxSeconds` is `0`

Open matux opened this issue 3 months ago • 0 comments

Description of the change

checkoutEveryNms defaults to 10 when maxSeconds is 0, inconsistent with rrweb’s expected behavior:

https://github.com/rrweb-io/rrweb/blob/76df9799ecc14930fa914e5623a73ea7726e3747/packages/rrweb/src/record/index.ts#L247-L252
    wrappedEmit = (r: eventWithoutTime, isCheckout?: boolean) => {
      ...
      const exceedTime =
        checkoutEveryNms &&
        e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
      if (exceedCount || exceedTime) {
        takeFullSnapshot(true);
      }
    }

Where a checkoutEveryNms of 0 means a single initial full snapshot, and continuous event emission with no checkouts.

Type of change

  • [x] Bug fix (non-breaking change that fixes an issue)
  • [ ] New feature (non-breaking change that adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Maintenance
  • [ ] New release

matux avatar Oct 02 '25 14:10 matux