refactor(core): Rename push sessionId to pushRef (#8905)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-04-03 13:43:14 +02:00
committed by GitHub
parent eaaefd76da
commit 072c3db97d
58 changed files with 248 additions and 257 deletions

View File

@@ -27,7 +27,7 @@ export class Telemetry {
}
private userNodesPanelSession: IUserNodesPanelSession = {
sessionId: '',
pushRef: '',
data: {
nodeFilter: '',
resultsNodes: [],
@@ -76,7 +76,7 @@ export class Telemetry {
this.identify(instanceId, userId, versionCli);
this.flushPageEvents();
this.track('Session started', { session_id: rootStore.sessionId });
this.track('Session started', { session_id: rootStore.pushRef });
}
identify(instanceId: string, userId?: string, versionCli?: string) {
@@ -150,8 +150,8 @@ export class Telemetry {
trackAskAI(event: string, properties: IDataObject = {}) {
if (this.rudderStack) {
properties.session_id = useRootStore().sessionId;
properties.ndv_session_id = useNDVStore().sessionId;
properties.session_id = useRootStore().pushRef;
properties.ndv_session_id = useNDVStore().pushRef;
switch (event) {
case 'askAi.generationFinished':
@@ -164,12 +164,12 @@ export class Telemetry {
trackNodesPanel(event: string, properties: IDataObject = {}) {
if (this.rudderStack) {
properties.nodes_panel_session_id = this.userNodesPanelSession.sessionId;
properties.nodes_panel_session_id = this.userNodesPanelSession.pushRef;
switch (event) {
case 'nodeView.createNodeActiveChanged':
if (properties.createNodeActive !== false) {
this.resetNodesPanelSession();
properties.nodes_panel_session_id = this.userNodesPanelSession.sessionId;
properties.nodes_panel_session_id = this.userNodesPanelSession.pushRef;
this.track('User opened nodes panel', properties);
}
break;
@@ -200,25 +200,25 @@ export class Telemetry {
break;
case 'nodeCreateList.onCategoryExpanded':
properties.is_subcategory = false;
properties.nodes_panel_session_id = this.userNodesPanelSession.sessionId;
properties.nodes_panel_session_id = this.userNodesPanelSession.pushRef;
this.track('User viewed node category', properties);
break;
case 'nodeCreateList.onViewActions':
properties.nodes_panel_session_id = this.userNodesPanelSession.sessionId;
properties.nodes_panel_session_id = this.userNodesPanelSession.pushRef;
this.track('User viewed node actions', properties);
break;
case 'nodeCreateList.onActionsCustmAPIClicked':
properties.nodes_panel_session_id = this.userNodesPanelSession.sessionId;
properties.nodes_panel_session_id = this.userNodesPanelSession.pushRef;
this.track('User clicked custom API from node actions', properties);
break;
case 'nodeCreateList.addAction':
properties.nodes_panel_session_id = this.userNodesPanelSession.sessionId;
properties.nodes_panel_session_id = this.userNodesPanelSession.pushRef;
this.track('User added action', properties);
break;
case 'nodeCreateList.onSubcategorySelected':
properties.category_name = properties.subcategory;
properties.is_subcategory = true;
properties.nodes_panel_session_id = this.userNodesPanelSession.sessionId;
properties.nodes_panel_session_id = this.userNodesPanelSession.pushRef;
delete properties.selected;
this.track('User viewed node category', properties);
break;
@@ -258,7 +258,7 @@ export class Telemetry {
}
private resetNodesPanelSession() {
this.userNodesPanelSession.sessionId = `nodes_panel_session_${new Date().valueOf()}`;
this.userNodesPanelSession.pushRef = `nodes_panel_session_${new Date().valueOf()}`;
this.userNodesPanelSession.data = {
nodeFilter: '',
resultsNodes: [],
@@ -271,7 +271,7 @@ export class Telemetry {
search_string: this.userNodesPanelSession.data.nodeFilter,
results_count: this.userNodesPanelSession.data.resultsNodes.length,
filter_mode: this.userNodesPanelSession.data.filterMode,
nodes_panel_session_id: this.userNodesPanelSession.sessionId,
nodes_panel_session_id: this.userNodesPanelSession.pushRef,
};
}

View File

@@ -5,7 +5,7 @@ declare global {
}
export interface IUserNodesPanelSession {
sessionId: string;
pushRef: string;
data: IUserNodesPanelSessionData;
}