merge(master): sync master into dev

This commit is contained in:
2026-08-04 17:58:24 +07:00
174 changed files with 14405 additions and 3136 deletions
+4
View File
@@ -8,6 +8,7 @@ import { describe, it, expect, beforeAll, afterAll, vi } from "vitest";
const originalDataDir = process.env.DATA_DIR;
let tempDir;
let db;
let adminOwnerId;
beforeAll(async () => {
tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "9router-concurrent-"));
@@ -15,6 +16,8 @@ beforeAll(async () => {
vi.resetModules();
db = await import("@/lib/db/index.js");
await db.initDb();
const admin = await db.createUser({ username: "concurrency-admin", password: "password", role: "admin" });
adminOwnerId = admin.id;
});
afterAll(() => {
@@ -102,6 +105,7 @@ describe("DB Concurrency — atomic safety", () => {
const conn = await db.createProviderConnection({
provider: "oauth-test", authType: "oauth", email: "x@y.com",
accessToken: "initial", refreshToken: "rt-initial",
ownerId: adminOwnerId,
});
// 20 parallel updates each with a unique field