Skip to content

Commit

Permalink
v6.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Jan 7, 2022
1 parent cdbceb6 commit dc76c67
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 22 deletions.
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions demo/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const Gleap = window.Gleap;

Gleap.initialize("wytzEhhSa1EFfTEqK3HXBWuGRt2PREAE");
Gleap.setApiUrl("http://localhost:9000");
Gleap.initialize("x8FMqDm2Q0Pl8f3SbDqyyIFVwOXa1Mws");

/*
Expand Down Expand Up @@ -32,9 +33,11 @@ setTimeout(() => {
console.warn(request.statusText, request.responseText);
}
});
request.send(JSON.stringify({
"asdf": "asdfasdf"
}));
request.send(
JSON.stringify({
asdf: "asdfasdf",
})
);
}, 2000);

Gleap.setNetworkLogFilters(["Authentication", "pragma"]);
Expand Down Expand Up @@ -68,3 +71,8 @@ Gleap.attachNetworkLogs([
},
},
]);

setTimeout(() => {
x();
// Gleap.sendSilentBugReport("Rage click detected.");
}, 5000);
19 changes: 19 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,29 @@ export namespace Gleap {
gleapId?: string,
gleapHash?: string
): void;
/**
* @deprecated Please use sendSilentReport instead.
*/
function sendSilentBugReport(
description: string,
priority: "LOW" | "MEDIUM" | "HIGH"
): void;
function sendSilentReport(
formData: {
[key: string]: string;
},
priority?: "LOW" | "MEDIUM" | "HIGH",
feedbackType?: string,
excludeData?: {
customData: Boolean;
metaData: Boolean;
consoleLog: Boolean;
networkLogs: Boolean;
customEventLog: Boolean;
screenshot: Boolean;
replays: Boolean;
}
): void;
function setCustomerEmail(email: string): void;
function attachCustomData(customData: any): void;
function setCustomData(key: string, value: string): void;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gleap",
"version": "6.5.9",
"version": "6.6.0",
"main": "build/index.js",
"scripts": {
"start": "webpack serve",
Expand Down
1 change: 1 addition & 0 deletions published/6.6.0/appwidget.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions published/6.6.0/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions published/6.6.0/index.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion published/latest/index.js

Large diffs are not rendered by default.

63 changes: 48 additions & 15 deletions src/Gleap.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,9 @@ class Gleap {
startRageClickDetector(function (target) {
instance.rageClickDetected = true;
if (instance.enabledRageClickDetectorSilent) {
Gleap.sendSilentBugReport("Rage click detected.");
Gleap.sendSilentReport({
description: "Rage click detected.",
});
} else {
Gleap.startFeedbackFlow("crash");
}
Expand Down Expand Up @@ -680,30 +682,50 @@ class Gleap {

/**
* Reports a bug silently
* @param {*} description
* @param {*} formData
* @param {*} priority
* @param {*} feedbackType
*/
static sendSilentBugReport(description, priority = Gleap.PRIORITY_MEDIUM) {
static sendSilentReport(
formData,
priority = Gleap.PRIORITY_MEDIUM,
feedbackType = "BUG",
excludeData = {}
) {
const instance = this.getInstance();
const sessionInstance = Session.getInstance();

if (!sessionInstance.ready) {
return;
}

instance.formData = {};
instance.excludeData = excludeData ? excludeData : {};
instance.severity = priority;
instance.feedbackType = feedbackType;

instance.formData = formData ? formData : {};
if (sessionInstance.session.email) {
instance.formData.reportedBy = sessionInstance.session.email;
}
if (description) {
instance.formData.description = description;
}

instance.severity = priority;
instance.feedbackType = "BUG";

this.startFeedbackFlow(null, true);
}

/**
* Reports a bug silently
* @param {*} description
* @deprecated Please use sendSilentReport instead.
*/
static sendSilentBugReport(description, priority = Gleap.PRIORITY_MEDIUM) {
return Gleap.sendSilentReport(
{
description: description,
},
priority,
"BUG"
);
}

/**
* Starts the feedback type selection flow.
*/
Expand Down Expand Up @@ -948,7 +970,7 @@ class Gleap {
"URL: " + url,
"Line: " + lineNo,
"Column: " + columnNo,
"Error object: " + JSON.stringify(error),
"Stack: " + (error && error.stack) ? error.stack : "",
];
self.addLog(message, "ERROR");

Expand All @@ -959,10 +981,21 @@ class Gleap {
) {
self.appCrashDetected = true;
if (self.enabledCrashDetectorSilent) {
const errorMessage = `Message: ${msg}\nURL: ${url}\nLine: ${lineNo}\nColumn: ${columnNo}\nError object: ${JSON.stringify(
error
)}\n`;
Gleap.sendSilentBugReport(errorMessage);
return Gleap.sendSilentReport(
{
errorMessage: msg,
url: url,
lineNo: lineNo,
columnNo: columnNo,
stackTrace: error && error.stack ? error.stack : "",
},
Gleap.PRIORITY_MEDIUM,
"CRASH",
{
screenshot: true,
replays: true,
}
);
} else {
Gleap.startFeedbackFlow("crash");
}
Expand Down

0 comments on commit dc76c67

Please sign in to comment.