feat: consolidate local-first mnote web runtime
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* 验证 EditorRuntimeActor Phase A:
|
||||
* - 块写工具(replace / insert_after)在 actor 启用时返回时间 < 800ms
|
||||
* - 多次写入循环不依赖 Convex RTT
|
||||
* - 多次写入循环不依赖远端 RTT
|
||||
* - 写后回读内容正确
|
||||
*
|
||||
* 依赖:运行中的 mnote-web (localhost:3000),已登录状态,测试 Helpers
|
||||
@@ -154,7 +154,7 @@ async function main() {
|
||||
console.log(`2/3 insert_after: ${insertMs}ms — ok`);
|
||||
|
||||
// 3. doc.fetch — 回读验证
|
||||
await sleep(500); // 等 Convex 写入完成
|
||||
await sleep(500); // 等待 runtime 写入完成
|
||||
const t4 = Date.now();
|
||||
const readbackRes = await callTool(request, {
|
||||
toolName: "mnote.doc.fetch",
|
||||
@@ -184,11 +184,11 @@ async function main() {
|
||||
assert.ok(texts.some((t) => t.includes("第三段")), "应包含第三段");
|
||||
assert.ok(texts.some((t) => t.includes("插入段")), "应包含插入段");
|
||||
|
||||
// ── 延迟断言:三次写循环总时间 < 800ms(不含 Convex wait) ──
|
||||
// ── 延迟断言:三次写循环总时间 < 800ms(不含回读等待) ──
|
||||
const writeTotal = replaceMs + insertMs;
|
||||
const allWithReadback = writeTotal + readbackMs;
|
||||
console.log(`\n=== 延迟报告 ===`);
|
||||
console.log(`三次操作总延迟(不含 await Convex): ${writeTotal}ms`);
|
||||
console.log(`三次操作总延迟(不含回读等待): ${writeTotal}ms`);
|
||||
console.log(`含回读总延迟: ${allWithReadback}ms`);
|
||||
|
||||
// 写操作若 > 800ms 打印 warning 但不 fail(因为首跑可能较慢)
|
||||
|
||||
Reference in New Issue
Block a user