Skip to content

Commit f7f5ae4

Browse files
committed
update sentry, init sentry before noNVC
1 parent 2637ffe commit f7f5ae4

4 files changed

Lines changed: 30 additions & 23 deletions

File tree

app/codio-sentry.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export const init = () => {
2+
const prodRe = /https:\/\/.+\.codio\.io$/;
3+
const prodUkRe = /https:\/\/.+\.codio-box\.uk$/;
4+
const isProd = prodRe.test(location.origin) || prodUkRe.test(location.origin);
5+
6+
window.Sentry?.init({
7+
// No need to configure DSN here, it is already configured in the loader script
8+
// You can add any additional configuration here
9+
dsn: "https://d08e273c89d12afcde41b3ec30d37ace@o108517.ingest.us.sentry.io/4505750448439296",
10+
release: 'TAG_VERSION',
11+
environment: isProd ? 'production' : 'development',
12+
ignoreErrors: [
13+
'ResizeObserver loop completed with undelivered notifications' // https://bugzilla.mozilla.org/show_bug.cgi?id=1685038
14+
]
15+
});
16+
};
17+
18+

core/input/keyboard.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export default class Keyboard {
8585
}
8686

8787
_handleKeyDown(e) {
88+
Log.Debug("_handleKeyDown", e, this._target);
8889
const code = this._getKeyCode(e);
8990
let keysym = KeyboardUtil.getKeysym(e);
9091
let numlock = e.getModifierState('NumLock');
@@ -268,19 +269,19 @@ export default class Keyboard {
268269
// ===== PUBLIC METHODS =====
269270

270271
grab() {
271-
//Log.Debug(">> Keyboard.grab");
272+
Log.Debug(">> Keyboard.grab", this._target);
272273

273274
this._target.addEventListener('keydown', this._eventHandlers.keydown);
274275
this._target.addEventListener('keyup', this._eventHandlers.keyup);
275276

276277
// Release (key up) if window loses focus
277278
window.addEventListener('blur', this._eventHandlers.blur);
278279

279-
//Log.Debug("<< Keyboard.grab");
280+
Log.Debug("<< Keyboard.grab");
280281
}
281282

282283
ungrab() {
283-
//Log.Debug(">> Keyboard.ungrab");
284+
Log.Debug(">> Keyboard.ungrab", this._target);
284285

285286
this._target.removeEventListener('keydown', this._eventHandlers.keydown);
286287
this._target.removeEventListener('keyup', this._eventHandlers.keyup);
@@ -289,6 +290,6 @@ export default class Keyboard {
289290
// Release (key up) all keys that are in a down state
290291
this._allKeysUp();
291292

292-
//Log.Debug(">> Keyboard.ungrab");
293+
Log.Debug(">> Keyboard.ungrab");
293294
}
294295
}

uploadToS3.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ replaceHtmlUrls () {
1010
}
1111

1212
replaceTagVersion () {
13-
sed -i "s/TAG_VERSION/${tag}/" "./vnc.html"
13+
sed -i "s/TAG_VERSION/${tag}/" "./app/codio-sentry.js"
1414
}
1515

1616
replaceJsUrls () {

vnc.html

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,37 +46,25 @@
4646
<link rel="preload" as="image" href="app/images/error.svg">
4747
<link rel="preload" as="image" href="app/images/warning.svg">
4848
<script
49-
src="https://js.sentry-cdn.com/d08e273c89d12afcde41b3ec30d37ace.min.js"
50-
crossorigin="anonymous"
49+
src="https://browser.sentry-cdn.com/10.53.1/bundle.min.js"
50+
integrity="sha384-jbb7+utXq5l+9udWjHUovKZyfWANLtC8QnVwrXU9YoCcldAlU6XJFdTHWdn2wFjk"
51+
crossorigin="anonymous"
5152
></script>
52-
<script>
53-
const prodRe = /https:\/\/.+\.codio\.io$/
54-
const prodUkRe = /https:\/\/.+\.codio-box\.uk$/
55-
const isProd = prodRe.test(location.origin) || prodUkRe.test(location.origin)
56-
Sentry.onLoad(function() {
57-
Sentry.init({
58-
// No need to configure DSN here, it is already configured in the loader script
59-
// You can add any additional configuration here
60-
release: 'TAG_VERSION',
61-
environment: isProd ? 'production' : 'development',
62-
ignoreErrors: [
63-
'ResizeObserver loop completed with undelivered notifications' // https://bugzilla.mozilla.org/show_bug.cgi?id=1685038
64-
]
65-
});
66-
});
67-
</script>
6853
<script type="module" crossorigin="anonymous" src="app/error-handler.js"></script>
6954

7055
<script type="module">
7156
import UI from "./app/ui.js";
7257
import * as Log from './core/util/logging.js';
7358
import * as CodioUtils from './app/codio-utils.js';
59+
import * as CodioSentry from './app/codio-sentry.js';
7460

7561
let response;
7662

7763
let defaults = {};
7864
let mandatory = {};
7965

66+
CodioSentry.init()
67+
8068
// Default settings will be loaded from defaults.json. Mandatory
8169
// settings will be loaded from mandatory.json, which the user
8270
// cannot change.

0 commit comments

Comments
 (0)