Add page data delivery and publication guards

This commit is contained in:
john
2026-07-08 21:10:47 +08:00
parent 8d629e7a4e
commit eea14c1855
66 changed files with 3035 additions and 413 deletions
+4 -3
View File
@@ -145,7 +145,7 @@ test('syncGeneratedPagesFromPublicAssets reuses db page when memory index is emp
const pool = {
async query(sql) {
if (sql.includes('JSON_UNQUOTE(JSON_EXTRACT(pv.source_snapshot_json')) {
return [[{ id: 'page-existing', updated_at: 100 }]];
return [[{ id: 'page-existing', updated_at: 100, version_no: 3 }]];
}
if (sql.includes('FROM h5_page_records p')) return [[]];
if (sql.includes('FROM h5_assets a')) return [[]];
@@ -157,8 +157,8 @@ test('syncGeneratedPagesFromPublicAssets reuses db page when memory index is emp
created.push(true);
return { id: 'page-new' };
},
async updatePage(userId, pageId) {
updated.push({ userId, pageId });
async updatePage(userId, pageId, input) {
updated.push({ userId, pageId, input });
return { id: pageId };
},
};
@@ -175,4 +175,5 @@ test('syncGeneratedPagesFromPublicAssets reuses db page when memory index is emp
assert.equal(created.length, 0);
assert.equal(updated.length, 1);
assert.equal(updated[0].pageId, 'page-existing');
assert.equal(updated[0].input.expectedVersion, 3);
});