fix(scheduled-task): deliver verified WeChat links only after page is ready
Memind CI / Test, build, and release guards (push) Successful in 8m42s
Memind CI / Test, build, and release guards (push) Successful in 8m42s
Wait for HTML materialization before releasing delivery contracts, pass verified MindSpace URLs through proactive WeChat sends, resend on reconcile when pages land late, and report deferred customer-service delivery as unsent. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+14
-3
@@ -2017,14 +2017,25 @@ export function createWechatMpService({
|
||||
});
|
||||
};
|
||||
|
||||
const sendTextToUser = async (userId, content) => {
|
||||
const sendTextToUser = async (userId, content, { verifiedHtmlUrls = [] } = {}) => {
|
||||
const openid = await userAuth.getWechatOpenidForUser(userId, config.appId);
|
||||
if (!openid) {
|
||||
throw new Error('用户尚未绑定服务号,无法推送提醒');
|
||||
}
|
||||
return sendCustomerServiceText(openid, content, null, {
|
||||
const normalizedVerified = verifiedHtmlUrls
|
||||
.map((url) => String(url ?? '').trim())
|
||||
.filter(Boolean);
|
||||
const sendOptions = {
|
||||
deliveryPriority: 'formal_reply',
|
||||
});
|
||||
verifiedHtmlUrls: normalizedVerified,
|
||||
};
|
||||
if (normalizedVerified.length > 0) {
|
||||
sendOptions.linkExistsForRequest = createPreparedPublicHtmlLinkExists({
|
||||
userId,
|
||||
prepared: { validReplyUrls: normalizedVerified },
|
||||
});
|
||||
}
|
||||
return sendCustomerServiceText(openid, content, null, sendOptions);
|
||||
};
|
||||
|
||||
const enforceFreshPageThumbnailDelivery = async ({
|
||||
|
||||
Reference in New Issue
Block a user