apple: no app info on App Store Connect is a clear error (it crashed apple listing / appinfo with "undefined is not an object (evaluating 'info.id')"); asset uploads use basename (a Windows path sent the whole C:\... path as fileName), reviews send --only and previews names split both separators; tests/matrix-bugs.test.ts

This commit is contained in:
CRTkafa 2026-10-14 08:29:26 +08:00
parent f58e192001
commit 2c14e5318a
5 changed files with 60 additions and 11 deletions

View file

@ -126,8 +126,8 @@ export async function run(ctx: Ctx): Promise<void> {
const drafts = only === undefined ? all : all.filter(d => d.file.split(/[\\/]/).pop() === only);
if (only !== undefined && !drafts.length) throw new Error(`no draft ${only} in ${dir}`);
const plan = sendPlan(drafts);
for (const s of plan.skip) log(TAG, `skip ${s.file.split('/').pop()}: ${s.why}`);
for (const d of plan.send) for (const i of checkReply(d.reply, d.store)) warn(TAG, `${d.file.split('/').pop()}: ${i.msg}`);
for (const s of plan.skip) log(TAG, `skip ${s.file.split(/[\\/]/).pop()}: ${s.why}`);
for (const d of plan.send) for (const i of checkReply(d.reply, d.store)) warn(TAG, `${d.file.split(/[\\/]/).pop()}: ${i.msg}`);
if (!plan.send.length) { done(TAG, 'nothing to send'); return; }
console.log(textTable(['store', 'review', 'chars', 'reply'], plan.send.map(d => [d.store, d.reviewId, [...d.reply].length, d.reply.replace(/\s+/g, ' ').slice(0, 70)])));
if (a.has('dry')) { done(TAG, `${plan.send.length} reply(ies) would be sent (dry run)`); return; }
@ -144,13 +144,13 @@ export async function run(ctx: Ctx): Promise<void> {
if (d.store === 'apple') {
try { await c!.asc(req.method, req.url, req.body); } catch (e) {
if (!isConflict(e)) throw e;
warn(TAG, `${d.file.split('/').pop()}: the review already has a response on the App Store (an earlier run sent it); noted as sent, not sent again`);
warn(TAG, `${d.file.split(/[\\/]/).pop()}: the review already has a response on the App Store (an earlier run sent it); noted as sent, not sent again`);
}
} else await play!.call(req.method, req.url, req.body);
writeFileSync(d.file, markSent(texts.get(d.file)!, new Date().toISOString()));
sent++;
log(TAG, `sent ${d.file.split('/').pop()}`);
} catch (e) { warn(TAG, `${d.file.split('/').pop()}: ${(e as Error).message.slice(0, 300)}`); }
log(TAG, `sent ${d.file.split(/[\\/]/).pop()}`);
} catch (e) { warn(TAG, `${d.file.split(/[\\/]/).pop()}: ${(e as Error).message.slice(0, 300)}`); }
}
done(TAG, `${sent}/${plan.send.length} sent (Apple shows replies within about 24 hours)`);
return;