You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// In the case of 'popstate' trigger, by the time the event fires, the URL has already changed, so we need to store what-will-be the *previous* URL for oldURL of next popstate ixn.
@@ -68,21 +75,23 @@ export class Aggregate extends AggregateBase {
68
75
serializer(eventBuffer){
69
76
// The payload depacker takes the first ixn of a payload (if there are multiple ixns) and positively offset the subsequent ixns timestamps by that amount.
70
77
// In order to accurately portray the real start & end times of the 2nd & onward ixns, we hence need to negatively offset their start timestamps with that of the 1st ixn.
71
-
letfirstIxnStartTime=0// the very 1st ixn does not require any offsetting
if(firstIxnStartTime===undefined)firstIxnStartTime=Math.floor(interaction.start)// careful not to match or overwrite on 0 value!
76
83
}
77
84
return`bel.7;${serializedIxnList.join(';')}`
78
85
}
79
86
80
87
startUIInteraction(eventName,startedAt,sourceElem){// this is throttled by instrumentation so that it isn't excessively called
81
88
if(this.interactionInProgress?.createdByApi)return// api-started interactions cannot be disrupted aka cancelled by UI events (and the vice versa applies as well)
// It's possible that a complete interaction occurs before page is fully loaded, so we need to consider if a route-change ixn may have overlapped this iPL
136
145
elsesaveIxn=finishedInteraction
137
146
}
@@ -196,9 +205,11 @@ export class Aggregate extends AggregateBase {
196
205
// In here, 'this' refers to the EventContext specific to per InteractionHandle instance spawned by each .interaction() api call.
197
206
// Each api call aka IH instance would therefore retain a reference to either the in-progress interaction *at the time of the call* OR a new api-started interaction.
if(this.associatedInteraction?.trigger===IPL_TRIGGER_NAME)this.associatedInteraction=null// the api get-interaction method cannot target IPL
199
209
if(!this.associatedInteraction){
200
210
// This new api-driven interaction will be the target of any subsequent .interaction() call, until it is closed by EITHER .end() OR the regular seenHistoryAndDomChange process.
thisClass.domObserver.observe(document.body,{attributes: true,childList: true,subtree: true,characterData: true})// start observing for DOM changes like a regular UI-driven interaction
0 commit comments