Skip to content

Commit 8d2593c

Browse files
committed
Add error codes and update regex
1 parent 845c669 commit 8d2593c

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

extension/background.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function downloadTranscript() {
108108
})
109109
console.log("Invalid file name. Transcript downloaded to TranscripTonic directory with simple file name.")
110110
// Logs anonymous errors to a Google sheet for swift debugging
111-
fetch(`https://script.google.com/macros/s/AKfycbydJjDgaRMTccagvK04U80um1rfAdgzz1VunCjDS799UqyGTFrvKLOz0ED8btnvA7Pxvw/exec?version=${chrome.runtime.getManifest().version}&error=${encodeURIComponent(err)}`, { mode: "no-cors" })
111+
fetch(`https://script.google.com/macros/s/AKfycbxiyQSDmJuC2onXL7pKjXgELK1vA3aLGZL5_BLjzCp7fMoQ8opTzJBNfEHQX_QIzZ-j4Q/exec?version=${chrome.runtime.getManifest().version}&code=009error=${encodeURIComponent(err)}`, { mode: "no-cors" })
112112
})
113113
}
114114

extension/content.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function meetingRoutines(uiType) {
171171
isTranscriptDomErrorCaptured = true
172172
showNotification(extensionStatusJSON_bug)
173173

174-
logError(err)
174+
logError("001", err)
175175
}
176176

177177
// **** REGISTER CHAT MESSAGES LISTENER **** //
@@ -195,15 +195,15 @@ function meetingRoutines(uiType) {
195195
console.error(err)
196196
showNotification(extensionStatusJSON_bug)
197197

198-
logError(err)
198+
logError("002", err)
199199
}
200200
}, 1000)
201201
} catch (err) {
202202
console.error(err)
203203
isChatMessagesDomErrorCaptured = true
204204
showNotification(extensionStatusJSON_bug)
205205

206-
logError(err)
206+
logError("003", err)
207207
}
208208

209209
// Show confirmation message from extensionStatusJSON, once observation has started, based on operation mode
@@ -239,7 +239,7 @@ function meetingRoutines(uiType) {
239239
console.error(err)
240240
showNotification(extensionStatusJSON_bug)
241241

242-
logError(err)
242+
logError("004", err)
243243
}
244244
})
245245
}
@@ -321,11 +321,11 @@ function transcriptMutationCallback(mutationsList, observer) {
321321
// console.log(transcript)
322322
} catch (err) {
323323
console.error(err)
324-
if (isTranscriptDomErrorCaptured == false && hasMeetingEnded == false) {
324+
if (!isTranscriptDomErrorCaptured && !hasMeetingEnded) {
325325
console.log(reportErrorMessage)
326326
showNotification(extensionStatusJSON_bug)
327327

328-
logError(err)
328+
logError("005", err)
329329
}
330330
isTranscriptDomErrorCaptured = true
331331
}
@@ -362,11 +362,11 @@ function chatMessagesMutationCallback(mutationsList, observer) {
362362
}
363363
catch (err) {
364364
console.error(err)
365-
if (isChatMessagesDomErrorCaptured == false && hasMeetingEnded == false) {
365+
if (!isChatMessagesDomErrorCaptured && !hasMeetingEnded) {
366366
console.log(reportErrorMessage)
367367
showNotification(extensionStatusJSON_bug)
368368

369-
logError(err)
369+
logError("006", err)
370370
}
371371
isChatMessagesDomErrorCaptured = true
372372
}
@@ -433,13 +433,15 @@ function updateMeetingTitle() {
433433
try {
434434
// NON CRITICAL DOM DEPENDENCY
435435
const title = document.querySelector(".u6vdEc").textContent
436-
const invalidFilenameRegex = /[^\w\-_.() ]/g
436+
const invalidFilenameRegex = /[<>:"/\\|?*\x00-\x1F]/g
437437
meetingTitle = title.replace(invalidFilenameRegex, '_')
438438
overWriteChromeStorage(["meetingTitle"], false)
439439
} catch (err) {
440440
console.error(err)
441441

442-
logError(err)
442+
if (!hasMeetingEnded) {
443+
logError("007", err)
444+
}
443445
}
444446
}
445447

@@ -528,8 +530,8 @@ const commonCSS = `background: rgb(255 255 255 / 10%);
528530

529531

530532
// Logs anonymous errors to a Google sheet for swift debugging
531-
function logError(err) {
532-
fetch(`https://script.google.com/macros/s/AKfycbydJjDgaRMTccagvK04U80um1rfAdgzz1VunCjDS799UqyGTFrvKLOz0ED8btnvA7Pxvw/exec?version=${chrome.runtime.getManifest().version}&error=${encodeURIComponent(err)}`, { mode: "no-cors" })
533+
function logError(code, err) {
534+
fetch(`https://script.google.com/macros/s/AKfycbxiyQSDmJuC2onXL7pKjXgELK1vA3aLGZL5_BLjzCp7fMoQ8opTzJBNfEHQX_QIzZ-j4Q/exec?version=${chrome.runtime.getManifest().version}&code=${code}&error=${encodeURIComponent(err)}`, { mode: "no-cors" })
533535
}
534536

535537

@@ -555,7 +557,7 @@ async function checkExtensionStatus() {
555557
.catch((err) => {
556558
console.error(err);
557559

558-
logError(err)
560+
logError("008", err)
559561
});
560562
}
561563

0 commit comments

Comments
 (0)