Skip to content

Commit 819bcb8

Browse files
committed
Nit: add snapshot comment
Explaining the need for use of deep copying deltas (snapshot)
1 parent 2231742 commit 819bcb8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/executors/ExecutorBase.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ export default abstract class ExecutorBase {
4949

5050
public enqueueDelta(delta: CoreDelta<SupportedModel>): void {
5151
logMethodCall("ExecutorBase.enqueueDelta", { delta });
52-
// deep copy (snapshot)
52+
/**
53+
* deep copy (snapshot)
54+
* if we add alias and then login to a user, we want to ensure that the external id of the
55+
* login call doesn't get included in the add alias call so this helps keep the changes separate
56+
*/
5357
const deltaCopy = JSON.parse(JSON.stringify(delta));
5458
this._deltaQueue.push(deltaCopy);
5559
}

0 commit comments

Comments
 (0)