From 1e39acd513887c6aaf4bace0919fe45c180ccddb Mon Sep 17 00:00:00 2001 From: Mattk70 Date: Sat, 19 Oct 2024 21:02:24 +0100 Subject: [PATCH] Fixed analyse selection when snr enabled reverted error/warning label shortening --- js/model.js | 2 +- js/ui.js | 8 ++++---- js/worker.js | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/js/model.js b/js/model.js index a7a43640..a0d13a37 100644 --- a/js/model.js +++ b/js/model.js @@ -300,7 +300,7 @@ class Model { if (DEBUG) console.log("No surviving tensors in batch", maskedTensorBatch.shape[0]) return [] } else { - keys = await maskedKeysTensor.data(); + keys = Array.from(await maskedKeysTensor.data()); maskedKeysTensor.dispose(); // - 1 tensor if (DEBUG) console.log("surviving tensors in batch", maskedTensorBatch.shape[0]) } diff --git a/js/ui.js b/js/ui.js index f1fb4311..06e6b461 100644 --- a/js/ui.js +++ b/js/ui.js @@ -22,7 +22,7 @@ console.warn = function() { originalWarn.apply(console, arguments); // Track the warning message using your tracking function - trackEvent(config.UUID, 'UIWarn', arguments[0], customURLEncode(arguments[1])); + trackEvent(config.UUID, 'Warnings', arguments[0], customURLEncode(arguments[1])); }; // Override console.error to intercept and track errors @@ -31,7 +31,7 @@ console.error = function() { originalError.apply(console, arguments); // Track the error message using your tracking function - trackEvent(config.UUID, 'UIError', arguments[0], customURLEncode(arguments[1])); + trackEvent(config.UUID, 'Errors', arguments[0], customURLEncode(arguments[1])); }; @@ -41,7 +41,7 @@ window.addEventListener('unhandledrejection', function(event) { const stackTrace = event.reason.stack; // Track the unhandled promise rejection - trackEvent(config.UUID, 'UUIPR', errorMessage, customURLEncode(stackTrace)); + trackEvent(config.UUID, 'Unhandled UI Promise Rejection', errorMessage, customURLEncode(stackTrace)); }); window.addEventListener('rejectionhandled', function(event) { @@ -50,7 +50,7 @@ window.addEventListener('rejectionhandled', function(event) { const stackTrace = event.reason.stack; // Track the unhandled promise rejection - trackEvent(config.UUID, 'HUIPR', errorMessage, customURLEncode(stackTrace)); + trackEvent(config.UUID, 'Handled UI Promise Rejection', errorMessage, customURLEncode(stackTrace)); }); let STATE = { diff --git a/js/worker.js b/js/worker.js index 05133c54..1a2d655e 100644 --- a/js/worker.js +++ b/js/worker.js @@ -49,7 +49,7 @@ console.warn = function() { originalWarn.apply(console, arguments); // Track the warning message using your tracking function - trackEvent(STATE.UUID, 'WW', arguments[0], customURLEncode(arguments[1])); + trackEvent(STATE.UUID, 'Worker Warning', arguments[0], customURLEncode(arguments[1])); }; // Override console.error to intercept and track errors @@ -58,11 +58,11 @@ console.error = function() { originalError.apply(console, arguments); // Track the error message using your tracking function - trackEvent(STATE.UUID, 'WE', arguments[0], customURLEncode(arguments[1])); + trackEvent(STATE.UUID, 'Worker Handled Errors', arguments[0], customURLEncode(arguments[1])); }; // Implement error handling in the worker self.onerror = function(message, file, lineno, colno, error) { - trackEvent(STATE.UUID, 'UWE', message, customURLEncode(error?.stack)); + trackEvent(STATE.UUID, 'Unhandled Worker Error', message, customURLEncode(error?.stack)); if (message.includes('dynamic link library')) generateAlert({type: 'error', message: 'There has been an error loading the model. This may be due to missing AVX support. Chirpity AI models require the AVX2 instructions set to run. If you have AVX2 enabled and still see this notice, please refer to this issue on Github.'}) // Return false not to inhibit the default error handling return false; @@ -74,7 +74,7 @@ self.addEventListener('unhandledrejection', function(event) { const stackTrace = event.reason?.stack; // Track the unhandled promise rejection - trackEvent(STATE.UUID, 'UWPR', errorMessage, customURLEncode(stackTrace)); + trackEvent(STATE.UUID, 'Unhandled Worker Promise Rejections', errorMessage, customURLEncode(stackTrace)); }); self.addEventListener('rejectionhandled', function(event) { @@ -83,7 +83,7 @@ self.addEventListener('rejectionhandled', function(event) { const stackTrace = event.reason?.stack; // Track the unhandled promise rejection - trackEvent(STATE.UUID, 'HWPR', errorMessage, customURLEncode(stackTrace)); + trackEvent(STATE.UUID, 'Handled Worker Promise Rejections', errorMessage, customURLEncode(stackTrace)); }); //Object will hold files in the diskDB, and the active timestamp from the most recent selection analysis.