Skip to content

Commit

Permalink
mandatory field checks reverted and scriploader edit
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 committed Sep 22, 2021
1 parent 1b2c9cf commit 549a728
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
14 changes: 14 additions & 0 deletions integrations/Sentry/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ class Sentry {
`sha384-S3qfdh3AsT1UN84WIYNuOX9vVOoFg3nB17Jp5/pTFGDBGBt+dtz7MGAV845efkZr`
);

SentryScriptLoader(
"Sentry",
`https://browser.sentry-cdn.com/6.12.0/rewriteframes.min.js`,
`sha384-WOm9k3kzVt1COFAB/zCXOFx4lDMtJh/2vmEizIwgog7OW0P/dPwl3s8f6MdwrD7q`
);

const formattedAllowUrls = convertObjectToArray(this.allowUrls);
const formattedDenyUrls = convertObjectToArray(this.denyUrls);
const formattedIgnoreErrors = convertObjectToArray(this.ignoreErrors);
Expand Down Expand Up @@ -127,6 +133,14 @@ class Sentry {
get(rudderElement.message, "traits.ip_address") ||
get(rudderElement.message, "context.traits.ip_address");

if (!userId && !email && !name && !ipAddress) {
// if no user identification property is present the event will be dropped
logger.debug(
"Any one of userId, email, name and ip_address is mandatory"
);
return;
}

const finalPayload = {
id: userId,
email: email,
Expand Down
5 changes: 0 additions & 5 deletions integrations/Sentry/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ const SentryScriptLoader = (id, src, integrity) => {
logger.debug("==parent script==", e);
logger.debug("==adding script==", js);
e.parentNode.insertBefore(js, e);
SentryScriptLoader(
"Sentry",
`https://browser.sentry-cdn.com/6.12.0/rewriteframes.min.js`,
`sha384-WOm9k3kzVt1COFAB/zCXOFx4lDMtJh/2vmEizIwgog7OW0P/dPwl3s8f6MdwrD7q`
);
};

export { SentryScriptLoader, convertObjectToArray };

0 comments on commit 549a728

Please sign in to comment.