File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,30 @@ export class ProfileBuffer extends BaseBuffer {
6868
6969 const existingProfile = await this . fetchProfile ( profile , logger ) ;
7070
71+ // Delete any properties that are not server related if we have a non-server profile
72+ if (
73+ existingProfile ?. properties . device !== 'server' &&
74+ profile . properties . device === 'server'
75+ ) {
76+ profile . properties = omit (
77+ [
78+ 'city' ,
79+ 'country' ,
80+ 'region' ,
81+ 'longitude' ,
82+ 'latitude' ,
83+ 'os' ,
84+ 'osVersion' ,
85+ 'browser' ,
86+ 'device' ,
87+ 'isServer' ,
88+ 'os_version' ,
89+ 'browser_version' ,
90+ ] ,
91+ profile . properties ,
92+ ) ;
93+ }
94+
7195 const mergedProfile : IClickhouseProfile = existingProfile
7296 ? deepMergeObjects ( existingProfile , omit ( [ 'created_at' ] , profile ) )
7397 : profile ;
You can’t perform that action at this time.
0 commit comments