From a27dda779fac43b0bf76044c50e06d97595daf84 Mon Sep 17 00:00:00 2001 From: sagivr2020 <72692043+sagivr2020@users.noreply.github.com> Date: Wed, 20 Oct 2021 11:42:33 +0300 Subject: [PATCH] fix(identity bug): change user name and user email (#64) * fix identity bug * test fix --- packages/web/src/utils.js | 4 ++-- packages/web/src/web-tracer.js | 4 ++-- packages/web/test/web-tracer.test.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/web/src/utils.js b/packages/web/src/utils.js index 3b12e7f..91c02db 100644 --- a/packages/web/src/utils.js +++ b/packages/web/src/utils.js @@ -5,8 +5,8 @@ class EpsagonUtils { userId, userName, userEmail, companyId, companyName, } = parentSpan.identifyFields; if (userId) span.setAttribute('user.id', parentSpan.identifyFields.userId); - if (userName) span.setAttribute('user.name', parentSpan.identifyFields.name); - if (userEmail) span.setAttribute('user.email', parentSpan.identifyFields.email); + if (userName) span.setAttribute('user.name', parentSpan.identifyFields.userName); + if (userEmail) span.setAttribute('user.email', parentSpan.identifyFields.userEmail); if (companyId) span.setAttribute('company.id', parentSpan.identifyFields.companyId); if (companyName) span.setAttribute('company.name', parentSpan.identifyFields.companyName); } diff --git a/packages/web/src/web-tracer.js b/packages/web/src/web-tracer.js index 5094862..b7b497c 100644 --- a/packages/web/src/web-tracer.js +++ b/packages/web/src/web-tracer.js @@ -63,8 +63,8 @@ function identify(options) { if (epsSpan) { epsSpan.identifyFields = { userId: options.userId, - name: options.name, - email: options.email, + userName: options.userName, + userEmail: options.userEmail, companyId: options.companyId, companyName: options.companyName, }; diff --git a/packages/web/test/web-tracer.test.js b/packages/web/test/web-tracer.test.js index c397da8..efbcf70 100644 --- a/packages/web/test/web-tracer.test.js +++ b/packages/web/test/web-tracer.test.js @@ -107,8 +107,8 @@ describe('tags tests', () => { it('identify adds tags to epsSpan', (done) => { const options = { userId: 'test user', - name: 'test name', - email: 'test email', + userName: 'test name', + userEmail: 'test email', companyId: 'company id test', companyName: 'company name', };