fix(broker): correct libsodium import in email connect callback
Some checks failed
CI / Lint (push) Has been cancelled
CI / Typecheck (push) Has been cancelled
CI / Broker tests (Postgres) (push) Has been cancelled
CI / Docker build (linux/amd64) (push) Has been cancelled

Dynamic import returns module wrapper, need .default.ready then .default
for the actual sodium functions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-04-09 17:09:32 +01:00
parent 6b55859d38
commit 2710f354a9

View File

@@ -4180,8 +4180,9 @@ function main(): void {
const existingMembers = Array.from(meshIds).map(meshId => ({ meshId }));
// For each mesh, create a new bridge member with a fresh keypair
const sodium = await import("libsodium-wrappers");
await sodium.ready;
const sodiumMod = await import("libsodium-wrappers");
await sodiumMod.default.ready;
const sodium = sodiumMod.default;
const results = [];
for (const em of existingMembers) {
const kp = sodium.crypto_sign_keypair();