fix(wechat): repair share preview on disk for sanitized delivery artifacts
Memind CI / Test, build, and release guards (push) Failing after 6s
Memind CI / Test, build, and release guards (push) Failing after 6s
Production WeChat delivery strips localPath from artifacts, so share-preview auto-repair never wrote back to HTML. Resolve paths via publishDir + relativePath, repair at materialize and delivery prep, and pass h5Root from Portal so page.generate can patch missing meta before sending links. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -81,17 +81,16 @@ test('MindSpace prepares WeChat HTML delivery with logical artifacts only', (t)
|
||||
},
|
||||
});
|
||||
|
||||
assert.equal(
|
||||
fs.readFileSync(
|
||||
path.join(
|
||||
publishDir,
|
||||
'public',
|
||||
'hello.html',
|
||||
),
|
||||
'utf8',
|
||||
const written = fs.readFileSync(
|
||||
path.join(
|
||||
publishDir,
|
||||
'public',
|
||||
'hello.html',
|
||||
),
|
||||
content,
|
||||
'utf8',
|
||||
);
|
||||
assert.match(written, /name="description"/);
|
||||
assert.match(written, /data-mindspace-page-tag="platform-brand"/);
|
||||
assert.equal(
|
||||
result.confirmedArtifacts.length,
|
||||
1,
|
||||
@@ -107,12 +106,12 @@ test('MindSpace prepares WeChat HTML delivery with logical artifacts only', (t)
|
||||
isStub: false,
|
||||
isHtmlDocument: true,
|
||||
sharePreview: {
|
||||
ok: false,
|
||||
reason: 'missing_description',
|
||||
ok: true,
|
||||
reason: null,
|
||||
},
|
||||
auxiliary: false,
|
||||
sizeBytes:
|
||||
Buffer.byteLength(content),
|
||||
Buffer.byteLength(written),
|
||||
},
|
||||
);
|
||||
assert.equal(
|
||||
|
||||
Reference in New Issue
Block a user