@extn/segi-js 0.2.9 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -351,6 +351,16 @@ async function activateReplay(args) {
351
351
  clickCount: 0,
352
352
  recordingEnabled: true
353
353
  };
354
+ let lastSessionBump = Date.now();
355
+ const bumpIfStale = () => {
356
+ const now = Date.now();
357
+ if (now - lastSessionBump < 6e4) return;
358
+ lastSessionBump = now;
359
+ bumpSessionActivity();
360
+ };
361
+ for (const ev of ["mousedown", "keydown", "scroll", "touchstart"]) {
362
+ window.addEventListener(ev, bumpIfStale, { passive: true, capture: true });
363
+ }
354
364
  const w = window;
355
365
  const scheduleRrwebStart = (run) => {
356
366
  let fired = false;
@@ -506,6 +516,7 @@ var replayApi = {
506
516
  */
507
517
  notifyRouteChange(url, title) {
508
518
  if (!active) return;
519
+ bumpSessionActivity();
509
520
  const nowBlocked = isPathBlocked(active.options, location.pathname);
510
521
  if (nowBlocked) {
511
522
  if (!active.paused) {
@@ -351,6 +351,16 @@ async function activateReplay(args) {
351
351
  clickCount: 0,
352
352
  recordingEnabled: true
353
353
  };
354
+ let lastSessionBump = Date.now();
355
+ const bumpIfStale = () => {
356
+ const now = Date.now();
357
+ if (now - lastSessionBump < 6e4) return;
358
+ lastSessionBump = now;
359
+ bumpSessionActivity();
360
+ };
361
+ for (const ev of ["mousedown", "keydown", "scroll", "touchstart"]) {
362
+ window.addEventListener(ev, bumpIfStale, { passive: true, capture: true });
363
+ }
354
364
  const w = window;
355
365
  const scheduleRrwebStart = (run) => {
356
366
  let fired = false;
@@ -506,6 +516,7 @@ var replayApi = {
506
516
  */
507
517
  notifyRouteChange(url, title) {
508
518
  if (!active) return;
519
+ bumpSessionActivity();
509
520
  const nowBlocked = isPathBlocked(active.options, location.pathname);
510
521
  if (nowBlocked) {
511
522
  if (!active.paused) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extn/segi-js",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "Browser JavaScript SDK for the segi error monitoring service",
5
5
  "license": "UNLICENSED",
6
6
  "main": "./dist/index.js",