From c390fff3618ff241c4ea3af92461a1bfc043cd25 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 6 Apr 2019 22:22:05 -0400 Subject: [PATCH] New: Associate same AnonToken with Sentry UI instance (#724) --- frontend/src/Store/Middleware/createSentryMiddleware.js | 2 ++ src/Lidarr.Http/Frontend/InitializeJsModule.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/frontend/src/Store/Middleware/createSentryMiddleware.js b/frontend/src/Store/Middleware/createSentryMiddleware.js index 27c8b5911..b567c83f1 100644 --- a/frontend/src/Store/Middleware/createSentryMiddleware.js +++ b/frontend/src/Store/Middleware/createSentryMiddleware.js @@ -64,6 +64,7 @@ export default function createSentryMiddleware() { branch, version, release, + userHash, isProduction } = window.Lidarr; @@ -83,6 +84,7 @@ export default function createSentryMiddleware() { }); sentry.configureScope((scope) => { + scope.setUser({ username: userHash }); scope.setTag('version', version); scope.setTag('production', isProduction); }); diff --git a/src/Lidarr.Http/Frontend/InitializeJsModule.cs b/src/Lidarr.Http/Frontend/InitializeJsModule.cs index b9595ca99..b30f7221f 100644 --- a/src/Lidarr.Http/Frontend/InitializeJsModule.cs +++ b/src/Lidarr.Http/Frontend/InitializeJsModule.cs @@ -2,6 +2,7 @@ using System.IO; using System.Text; using Nancy; using Nancy.Responses; +using NzbDrone.Common; using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Core.Analytics; using NzbDrone.Core.Configuration; @@ -66,6 +67,7 @@ namespace Lidarr.Http.Frontend builder.AppendLine($" version: '{BuildInfo.Version.ToString()}',"); builder.AppendLine($" branch: '{_configFileProvider.Branch.ToLower()}',"); builder.AppendLine($" analytics: {_analyticsService.IsEnabled.ToString().ToLowerInvariant()},"); + builder.AppendLine($" userHash: '{HashUtil.AnonymousToken()}',"); builder.AppendLine($" urlBase: '{_urlBase}',"); builder.AppendLine($" isProduction: {RuntimeInfo.IsProduction.ToString().ToLowerInvariant()}"); builder.AppendLine("};");