Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[871]_2 Deep Scan medium and low, non boomerang fixes #233

Merged
merged 14 commits into from
Jul 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions lib/countly.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@
}

this.initialize = function() {
this.serialize = ob.serialize || Countly.serialize;
this.deserialize = ob.deserialize || Countly.deserialize;
this.getViewName = ob.getViewName || Countly.getViewName;
this.getViewUrl = ob.getViewUrl || Countly.getViewUrl;
this.getSearchQuery = ob.getSearchQuery || Countly.getSearchQuery;
this.serialize = getConfig("serialize", ob, Countly.serialize);
this.deserialize = getConfig("deserialize", ob, Countly.deserialize);
this.getViewName = getConfig("getViewName", ob, Countly.getViewName);
this.getViewUrl = getConfig("getViewUrl", ob, Countly.getViewUrl);
this.getSearchQuery = getConfig("getSearchQuery", ob, Countly.getSearchQuery);
this.DeviceIdType = Countly.DeviceIdType; // it is Countly device Id type Enums for clients to use
this.namespace = getConfig("namespace", ob, "");
this.clearStoredId = getConfig("clear_stored_id", ob, false);
Expand Down Expand Up @@ -351,7 +351,7 @@
}

if (this.ignore_visitor) {
log(logLevelEnums.WARNING, "initialize, Ignoring this visitor");
log(logLevelEnums.WARNING, "initialize, ignore_visitor:[" + this.ignore_visitor + "], this user will not be tracked");
return;
}

Expand Down Expand Up @@ -407,10 +407,6 @@
if (this.remote_config) {
log(logLevelEnums.DEBUG, "initialize, remote_config callback provided:[" + !!this.remote_config + "]");
}
// if ignore_visitor is enabled warn the user
if (this.ignore_visitor) {
log(logLevelEnums.WARNING, "initialize, ignore_visitor:[" + this.ignore_visitor + "], this user will not be tracked");
}
if (this.track_domains) {
log(logLevelEnums.DEBUG, "initialize, tracking domain info:[" + this.track_domains + "]");
}
Expand Down Expand Up @@ -1228,10 +1224,10 @@
campaign_id = campaign_id || setGetValueInStorage("cly_cmp_id") || "cly_organic";
campaign_user_id = campaign_user_id || setGetValueInStorage("cly_cmp_uid");

if (campaign_id && campaign_user_id) {
if (campaign_user_id) {
toRequestQueue({ campaign_id: campaign_id, campaign_user: campaign_user_id });
}
else if (campaign_id) {
else {
toRequestQueue({ campaign_id: campaign_id });
}
}
Expand Down Expand Up @@ -1792,7 +1788,6 @@
reportViewDuration();
// truncate page name and segmentation wrt internal limits
page = truncateSingleValue(page, self.maxKeyLength, "track_pageview", log);
viewSegments = truncateObject(viewSegments, self.maxKeyLength, self.maxValueSize, self.maxSegmentationValues, "track_pageview", log);
// if the first parameter we got is an array we got the ignoreList first, assign it here
if (page && Array.isArray(page)) {
ignoreList = page;
Expand Down Expand Up @@ -1865,6 +1860,8 @@
}

if (viewSegments) {
viewSegments = truncateObject(viewSegments, self.maxKeyLength, self.maxValueSize, self.maxSegmentationValues, "track_pageview", log);

for (var key in viewSegments) {
if (typeof segments[key] === "undefined") {
segments[key] = viewSegments[key];
Expand Down Expand Up @@ -2943,8 +2940,6 @@
else {
error = err + "";
}
// truncate custom crash segment's key value pairs
segments = truncateObject(segments, self.maxKeyLength, self.maxValueSize, self.maxSegmentationValues, "record_error", log);
// character limit check
if (error.length > (self.maxStackTraceLineLength * self.maxStackTraceLinesPerThread)) {
log(logLevelEnums.DEBUG, "record_error, Error stack is too long will be truncated");
Expand Down Expand Up @@ -2992,6 +2987,8 @@
obj._view = this.getViewName();

if (typeof segments !== "undefined") {
// truncate custom crash segment's key value pairs
segments = truncateObject(segments, self.maxKeyLength, self.maxValueSize, self.maxSegmentationValues, "record_error", log);
obj._custom = segments;
}

Expand Down