fixes and page test plan

This commit is contained in:
Evgeny @ SimpleX Chat
2026-02-05 23:42:31 +00:00
parent df3b7a5af9
commit 78dc2cddec
3 changed files with 1203 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,12 @@
import {defineConfig, type Plugin} from 'vite'
import {readFileSync} from 'fs'
import {createHash} from 'crypto'
import {resolve} from 'path'
import presets from './web/servers.json'
import {PORT_FILE} from './test/globalSetup'
const __dirname = import.meta.dirname
function parseHost(addr: string): string {
const m = addr.match(/@(.+)$/)
if (!m) throw new Error('bad server address: ' + addr)
@@ -46,7 +49,8 @@ export default defineConfig(({mode}) => {
return {
root: 'web',
build: {outDir: '../dist-web', target: 'esnext'},
build: {outDir: resolve(__dirname, 'dist-web'), target: 'esnext'},
preview: {host: true},
define,
worker: {format: 'es' as const},
plugins: [cspPlugin(servers)],

View File

@@ -182,6 +182,7 @@ async function handleCleanup(id: number) {
// ── Message dispatch ────────────────────────────────────────────
self.onmessage = async (e: MessageEvent) => {
await initPromise
const msg = e.data
try {
switch (msg.type) {
@@ -219,7 +220,7 @@ function digestEqual(a: Uint8Array, b: Uint8Array): boolean {
// ── Init ────────────────────────────────────────────────────────
;(async () => {
const initPromise = (async () => {
await sodium.ready
await sweepStale()
})()