@absolutejs/beacon 0.6.9 → 0.6.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.
package/dist/index.js CHANGED
@@ -713,6 +713,7 @@ var createBeacon = (options) => {
713
713
  const STALE_RELEASE_HISTORY_LIMIT = 5;
714
714
  const FORM_FRUSTRATION_THRESHOLD = 3;
715
715
  const FORM_FRUSTRATION_WINDOW_MS = 60000;
716
+ const LAYOUT_SHIFT_RECENT_INTERACTION_MS = 500;
716
717
  const FORM_INVALID_BURST_GAP_MS = 100;
717
718
  const SIGNAL_TEXT_MAX = 180;
718
719
  const slowResponseMs = signals?.slowResponseMs ?? SLOW_RESPONSE_DEFAULT_MS;
@@ -940,7 +941,7 @@ var createBeacon = (options) => {
940
941
  event.extra = context.extra;
941
942
  push(event);
942
943
  };
943
- const emitSignal = (message, signalTags, traceId, extra, stackBoundary, fallbackFramesToDrop = 1) => {
944
+ const emitSignal = (message, signalTags, traceId, extra, stackBoundary, fallbackFramesToDrop = 1, useDefaultFingerprint = false) => {
944
945
  const error = new Error(message);
945
946
  const captureStackTrace = Error.captureStackTrace;
946
947
  if (captureStackTrace !== undefined) {
@@ -958,7 +959,7 @@ var createBeacon = (options) => {
958
959
  `);
959
960
  }
960
961
  captureException(error, {
961
- groupingKey: signalGroupingKey(signalTags),
962
+ ...useDefaultFingerprint ? {} : { groupingKey: signalGroupingKey(signalTags) },
962
963
  level: "warning",
963
964
  tags: signalTags,
964
965
  ...traceId !== undefined ? { traceId } : {},
@@ -1542,7 +1543,7 @@ var createBeacon = (options) => {
1542
1543
  inSignalConsole = true;
1543
1544
  const text = args.map(String).join(" ").trim().slice(0, SIGNAL_TEXT_MAX);
1544
1545
  if (text !== "")
1545
- emitSignal(text, { signal: BEACON_SIGNAL.CONSOLE_ERROR }, undefined, undefined, wrappedConsole, 2);
1546
+ emitSignal(text, { signal: BEACON_SIGNAL.CONSOLE_ERROR }, undefined, undefined, wrappedConsole, 2, true);
1546
1547
  if (text !== "")
1547
1548
  reportErrorClick?.("ConsoleError");
1548
1549
  inSignalConsole = false;
@@ -1611,6 +1612,7 @@ var createBeacon = (options) => {
1611
1612
  return;
1612
1613
  recentInteraction = {
1613
1614
  at: Date.now(),
1615
+ performanceAt: performance.now(),
1614
1616
  target: targetName,
1615
1617
  type: "click"
1616
1618
  };
@@ -1663,6 +1665,7 @@ var createBeacon = (options) => {
1663
1665
  beginAction("submit", target);
1664
1666
  recentInteraction = {
1665
1667
  at: Date.now(),
1668
+ performanceAt: performance.now(),
1666
1669
  target,
1667
1670
  type: "submit"
1668
1671
  };
@@ -1677,6 +1680,7 @@ var createBeacon = (options) => {
1677
1680
  beginAction("keyboard", targetName);
1678
1681
  recentInteraction = {
1679
1682
  at: Date.now(),
1683
+ performanceAt: performance.now(),
1680
1684
  target: targetName,
1681
1685
  type: "keyboard"
1682
1686
  };
@@ -2214,7 +2218,9 @@ var createBeacon = (options) => {
2214
2218
  const observer = new PerformanceObserver((list) => {
2215
2219
  for (const raw of list.getEntries()) {
2216
2220
  const entry = raw;
2217
- if (entry.hadRecentInput === true || (entry.value ?? 0) < minimum)
2221
+ const interactionAgeMs = recentInteraction === undefined ? undefined : entry.startTime - recentInteraction.performanceAt;
2222
+ const beaconSawRecentInput = interactionAgeMs !== undefined && interactionAgeMs >= 0 && interactionAgeMs <= LAYOUT_SHIFT_RECENT_INTERACTION_MS;
2223
+ if (entry.hadRecentInput === true || beaconSawRecentInput || (entry.value ?? 0) < minimum)
2218
2224
  continue;
2219
2225
  const targets = (entry.sources ?? []).map(({ node }) => node instanceof Element ? describeElement(node) : undefined).filter((target) => target !== undefined).slice(0, 5);
2220
2226
  const key = targets.join(",") || "unknown";
@@ -3695,5 +3701,5 @@ export {
3695
3701
  BEACON_ATTRIBUTE
3696
3702
  };
3697
3703
 
3698
- //# debugId=D59101AFB8434CF164756E2164756E21
3704
+ //# debugId=4A2076E84A38E88A64756E2164756E21
3699
3705
  //# sourceMappingURL=index.js.map