mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(editor): Fix for logging error on user logout (#4633)
* 🐛 Fixing telemetry errors on user logout * 🔥 Removing call to `rudder.indentify` when users log out * 👌 Addressing review comment Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
0daa36c197
commit
7483e147fc
@@ -33,22 +33,19 @@ export default mixins(externalHooks).extend({
|
|||||||
telemetry(): ITelemetrySettings {
|
telemetry(): ITelemetrySettings {
|
||||||
return this.settingsStore.telemetry;
|
return this.settingsStore.telemetry;
|
||||||
},
|
},
|
||||||
|
isTelemetryEnabled(): boolean {
|
||||||
|
return !!this.telemetry?.enabled;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
if (this.isTelemetryInitialized || !this.isTelemetryEnabledOnRoute) return;
|
if (this.isTelemetryInitialized || !this.isTelemetryEnabledOnRoute || !this.isTelemetryEnabled) return;
|
||||||
|
|
||||||
const telemetrySettings = this.telemetry;
|
|
||||||
|
|
||||||
if (!telemetrySettings || !telemetrySettings.enabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$telemetry.init(
|
this.$telemetry.init(
|
||||||
telemetrySettings,
|
this.telemetry,
|
||||||
{
|
{
|
||||||
instanceId: this.rootStore.instanceId,
|
instanceId: this.rootStore.instanceId,
|
||||||
userId: this.currentUserId,
|
userId: this.currentUserId,
|
||||||
@@ -69,7 +66,9 @@ export default mixins(externalHooks).extend({
|
|||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
currentUserId(userId) {
|
currentUserId(userId) {
|
||||||
this.$telemetry.identify(this.rootStore.instanceId, userId);
|
if (this.isTelemetryEnabled) {
|
||||||
|
this.$telemetry.identify(this.rootStore.instanceId, userId);
|
||||||
|
}
|
||||||
this.$externalHooks().run('telemetry.currentUserIdChanged', {
|
this.$externalHooks().run('telemetry.currentUserIdChanged', {
|
||||||
instanceId: this.rootStore.instanceId,
|
instanceId: this.rootStore.instanceId,
|
||||||
userId,
|
userId,
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ export class Telemetry {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.rudderStack.reset();
|
this.rudderStack.reset();
|
||||||
this.rudderStack.identify(undefined, traits);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user