Skip to content

Commit

Permalink
v6.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Mar 7, 2022
1 parent e4028ab commit afb1e78
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gleap",
"version": "6.8.3",
"version": "6.8.4",
"main": "build/index.js",
"scripts": {
"start": "webpack serve",
Expand Down
2 changes: 1 addition & 1 deletion published/6.8.3/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions published/6.8.4/appwidget.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions published/6.8.4/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions published/6.8.4/index.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion published/latest/index.js

Large diffs are not rendered by default.

21 changes: 15 additions & 6 deletions src/ReplayRecorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default class ReplayRecorder {
this.node = document.documentElement;
this.nextID = 1;
this.actions = [];
this.actionsSize = 0;
this.lastActionTime = Date.now();
this.observerCallback = this.callback.bind(this);
this.resourcesToResolve = {};
Expand All @@ -30,7 +31,7 @@ export default class ReplayRecorder {
}

isFull() {
if (this.actions && gleapRoughSizeOfObject(this.actions) > 10) {
if (this.actions && this.actionsSize > 10) {
return true;
}
return false;
Expand Down Expand Up @@ -464,6 +465,14 @@ export default class ReplayRecorder {
}
}

appendAction(action) {
this.actions.push(action);
const self = this;
setTimeout(function () {
self.actionsSize += gleapRoughSizeOfObject(action);
}, 0);
}

callback(
records,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand All @@ -473,7 +482,7 @@ export default class ReplayRecorder {
if (now > this.lastActionTime) {
const a = {};
a[REPLAYREC_DELAY] = now - this.lastActionTime;
this.actions.push(a);
this.appendAction(a);
}
this.lastActionTime = Date.now();

Expand All @@ -487,7 +496,7 @@ export default class ReplayRecorder {
}
const a = {};
a[REPLAYREC_REMOVE] = childID;
this.actions.push(a);
this.appendAction(a);
this.deleteAllReplayRecIDs(child);
}
}
Expand Down Expand Up @@ -519,7 +528,7 @@ export default class ReplayRecorder {
);
}

this.actions.push(a);
this.appendAction(a);
}
break;
}
Expand All @@ -528,7 +537,7 @@ export default class ReplayRecorder {
if (target.nodeType === Node.TEXT_NODE) {
a[REPLAYREC_TEXT] = [id, target.data];
}
this.actions.push(a);
this.appendAction(a);
break;
}
case "childList": {
Expand Down Expand Up @@ -558,7 +567,7 @@ export default class ReplayRecorder {
serializedNode,
actions,
];
this.actions.push(a);
this.appendAction(a);
}
}
} catch (ex) {
Expand Down

0 comments on commit afb1e78

Please sign in to comment.