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
Copy file name to clipboardExpand all lines: src/features/soft_navigations/aggregate/index.js
+1-9Lines changed: 1 addition & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -26,15 +26,7 @@ export class Aggregate extends AggregateBase {
26
26
if(agentRef.runtime.session?.isNew)this.initialPageLoadInteraction.customAttributes.isFirstOfSession=true// mark the hard page load as first of its session
27
27
this.initialPageLoadInteraction.forceSave=true// unless forcibly ignored, iPL always finish by default
28
28
constixn=this.initialPageLoadInteraction
29
-
/** this.events (ixns to harvest) has already been set up, use it immediately */
this.#setupEventStore(agentEntityGuid)// if there's no entity guid, wont dont anything, and will wait for rum flags
39
-
}else{
37
+
this.#setupEventStore(agentEntityGuid)
38
+
if(!agentEntityGuid){
39
+
/** wait for the entity guid from the rum response and use to it to further configure things to set the default entity to share an indexed entity with entityGuid */
40
40
this.ee.on('entity-added',entity=>{
41
-
this.#setupEventStore(entity.entityGuid)
41
+
// not all event managers have this fn, like ST and SR
42
+
// this allows the lookup to work for the default and an entityGuid without creating two separate buffers
43
+
this.events?.setEventStore?.(entity.entityGuid)
42
44
})
43
45
}
44
46
}
@@ -49,7 +51,7 @@ export class AggregateBase extends FeatureBase {
49
51
* @returns {void}
50
52
*/
51
53
#setupEventStore (entityGuid){
52
-
if(this.events||!entityGuid)return
54
+
if(this.events)return
53
55
switch(this.featureName){
54
56
// SessionTrace + Replay have their own storage mechanisms.
constDEFAULT_KEY='NR_CONTAINER_AGENT'// this is the default entity guid used for the default storage instance
8
10
/**
9
11
* This layer allows multiple browser entity apps, or "target", to each have their own segregated storage instance.
10
12
* The purpose is so the harvester can send data to different apps within the same agent. Each feature should have a manager if it needs this capability.
@@ -13,27 +15,38 @@ export class EventStoreManager {
13
15
/**
14
16
* @param {object} agentRef - reference to base agent class
15
17
* @param {EventBuffer|EventAggregator} storageClass - the type of storage to use in this manager; 'EventBuffer' (1), 'EventAggregator' (2)
18
+
* @param {string} [defaultEntityGuid] - the entity guid to use as the default storage instance; if not provided, a new one is created
19
+
* @param {string} featureName - the name of the feature this manager is for; used for event dispatching
0 commit comments