Skip to content

Commit

Permalink
add maxSizeReached
Browse files Browse the repository at this point in the history
  • Loading branch information
metal-messiah committed Feb 2, 2025
1 parent 10d1f7b commit d046881
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/features/generic_events/aggregate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export class Aggregate extends AggregateBase {
host: globalScope.location?.host,
paths: userJourneyPaths,
timestamps: userJourneyTimestamps,
navs: userJourneyPaths.split('>').length
navs: userJourneyPaths.split('>').length,
maxSizeReached: false
}

this.waitForFlags(['ins']).then(([ins]) => {
Expand All @@ -53,8 +54,10 @@ export class Aggregate extends AggregateBase {
pathname
// search
} = new URL(url)
if (this.userJourney.paths.length + pathname.length + hash.length > 4096) return
if (this.userJourney.timestamps.length + ('' + timestamp).length > 4096) return
if (this.userJourney.paths.length + pathname.length + hash.length > 4096 || this.userJourney.timestamps.length + ('' + timestamp).length > 4096) {
this.userJourney.maxSizeReached = true
return
}

if (this.userJourney.paths) this.userJourney.paths += '>'
this.userJourney.paths += pathname + hash
Expand All @@ -67,6 +70,7 @@ export class Aggregate extends AggregateBase {
this.addEvent({
eventType: 'SessionMetadata',

maxSizeReached: this.userJourney.maxSizeReached,
navs: this.userJourney.navs,
host: this.userJourney.host,
paths: this.userJourney.paths,
Expand Down

0 comments on commit d046881

Please sign in to comment.