Quick and dirty mass dependency update

This commit is contained in:
Max Goodhart
2023-04-14 22:19:59 -07:00
parent 5c10e7fc82
commit a581ba2c6f
5 changed files with 10829 additions and 11289 deletions

View File

@@ -13,7 +13,10 @@ export default class StreamdelayClient extends EventEmitter {
}
connect() {
const wsURL = url.resolve(this.endpoint, `ws?key=${this.key}`)
const wsURL = url.resolve(
this.endpoint.replace(/^http/, 'ws'),
`ws?key=${this.key}`,
)
const ws = (this.ws = new ReconnectingWebSocket(wsURL, [], {
WebSocket,
maxReconnectionDelay: 5000,

View File

@@ -3,7 +3,7 @@ import path from 'path'
import yargs from 'yargs'
import TOML from '@iarna/toml'
import * as Y from 'yjs'
import * as Sentry from '@sentry/electron'
import * as Sentry from '@sentry/electron/main'
import { app, shell, session, BrowserWindow } from 'electron'
import { ensureValidURL } from '../util'
@@ -210,16 +210,7 @@ function parseArgs() {
.help().argv
}
async function main() {
const argv = parseArgs()
if (argv.help) {
return
}
if (argv.telemetry.sentry) {
Sentry.init({ dsn: SENTRY_DSN })
}
async function main(argv) {
// Reject all permission requests from web content.
session
.fromPartition('persist:session')
@@ -435,15 +426,28 @@ async function main() {
}
}
if (require.main === module) {
function init() {
const argv = parseArgs()
if (argv.help) {
return
}
if (argv.telemetry.sentry) {
Sentry.init({ dsn: SENTRY_DSN })
}
app.commandLine.appendSwitch('high-dpi-support', 1)
app.commandLine.appendSwitch('force-device-scale-factor', 1)
app.enableSandbox()
app
.whenReady()
.then(main)
.then(() => main(argv))
.catch((err) => {
console.trace(err.toString())
process.exit(1)
})
}
if (require.main === module) {
init()
}

View File

@@ -86,12 +86,12 @@ describe('streamwall server', () => {
async function recvMsg() {
const {
value: [data],
value: [data, isBinary],
} = await msgs.next()
if (typeof data === 'string') {
return JSON.parse(data)
if (isBinary) {
return data
}
return data
return JSON.parse(data.toString())
}
function sendMsg(msg) {