Add page data delivery and publication guards
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user