feat: add testing support for crypto initialization and process management, including auto-recovery and filtering of go wrapper processes

This commit is contained in:
2026-03-05 00:28:01 +00:00
parent 54fe479792
commit a7e28b0267
8 changed files with 527 additions and 41 deletions
-7
View File
@@ -8,7 +8,6 @@ import (
"log/slog"
"os"
"path/filepath"
"strings"
"maunium.net/go/mautrix/event"
@@ -55,12 +54,6 @@ func New(cfg *config.AgentConfig, rules []decision.Rule, logger *slog.Logger) (*
logger.Info("initializing e2ee", "store", storePath)
cryptoStore, err = matrixClient.InitCrypto(context.Background(), storePath, pickleKey, cfg.Agent.ID)
if err != nil {
if strings.Contains(err.Error(), "not marked as shared") {
logger.Error("crypto store is inconsistent with server — need a fresh device",
"store", storePath,
"fix", "delete crypto.db, login with password to get new token+device, update .env, restart",
)
}
return nil, fmt.Errorf("e2ee init: %w", err)
}
logger.Info("e2ee ready")