@openreplay/tracker 18.0.3 → 18.0.4

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/cjs/entry.js CHANGED
@@ -4009,7 +4009,7 @@ class App {
4009
4009
  this.stopCallbacks = [];
4010
4010
  this.commitCallbacks = [];
4011
4011
  this.activityState = ActivityState.NotActive;
4012
- this.version = '18.0.3'; // TODO: version compatability check inside each plugin.
4012
+ this.version = '18.0.4'; // TODO: version compatability check inside each plugin.
4013
4013
  this.socketMode = false;
4014
4014
  this.compressionThreshold = 24 * 1000;
4015
4015
  this.bc = null;
@@ -5198,7 +5198,7 @@ class App {
5198
5198
  ...this.getTrackerInfo(),
5199
5199
  timestamp,
5200
5200
  doNotRecord: false,
5201
- bufferDiff: timestamp - this.coldStartTs,
5201
+ bufferDiff: this.coldStartTs ? timestamp - this.coldStartTs : 0,
5202
5202
  userID: this.session.getInfo().userID,
5203
5203
  token: isNewSession ? undefined : sessionToken,
5204
5204
  deviceMemory,
@@ -7384,7 +7384,7 @@ class NetworkMessage {
7384
7384
  return null;
7385
7385
  const gqlHeader = "application/graphql-response";
7386
7386
  const isGraphql = messageInfo.url.includes("/graphql")
7387
- || Object.values(messageInfo.request.headers).some(v => v.includes(gqlHeader));
7387
+ || Object.values(messageInfo.request.headers).some(v => v && v.includes(gqlHeader));
7388
7388
  if (isGraphql && messageInfo.response.body && typeof messageInfo.response.body === 'string') {
7389
7389
  const isError = messageInfo.response.body.includes("errors");
7390
7390
  messageInfo.status = isError ? 400 : 200;
@@ -7488,6 +7488,7 @@ const genStringBody = (body) => {
7488
7488
  }
7489
7489
  else if (body instanceof Blob ||
7490
7490
  body instanceof ReadableStream ||
7491
+ ArrayBuffer.isView(body) ||
7491
7492
  body instanceof ArrayBuffer) {
7492
7493
  result = 'byte data';
7493
7494
  }
@@ -8976,7 +8977,7 @@ class ConstantProperties {
8976
8977
  user_id: this.user_id,
8977
8978
  distinct_id: this.deviceId,
8978
8979
  sdk_edition: 'web',
8979
- sdk_version: '18.0.3',
8980
+ sdk_version: '18.0.4',
8980
8981
  timezone: getUTCOffsetString(),
8981
8982
  search_engine: this.searchEngine,
8982
8983
  };
@@ -9678,7 +9679,7 @@ class API {
9678
9679
  this.signalStartIssue = (reason, missingApi) => {
9679
9680
  const doNotTrack = this.checkDoNotTrack();
9680
9681
  console.log("Tracker couldn't start due to:", JSON.stringify({
9681
- trackerVersion: '18.0.3',
9682
+ trackerVersion: '18.0.4',
9682
9683
  projectKey: this.options.projectKey,
9683
9684
  doNotTrack,
9684
9685
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,