Dormant import honors dry (it wrote rows even with dry: true); e2e 125/125

Not deployed: ships with the go-live deploy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-17 10:06:15 -06:00
parent cf0da5044a
commit 0e508312c9
2 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -598,7 +598,8 @@ const server = http.createServer(async (req, res) => {
if (!/^\d{1,9}$/.test(oldId) || !/^h_[0-9a-f]{16}$/.test(hubId) || store.packets().some(x => x.old && x.old.oldId === oldId)) { skipped++; continue; }
const name = cleanText(r.name, C.packet.name).slice(0, C.packet.name); const url = String(r.url || '').trim().slice(0, 500);
if (name.length < 2 || !/^https?:\/\//i.test(url)) { skipped++; continue; }
store.addPacket({ owner: '', ownerName: null, status: 'dormant', stage: 'sprouting', name, url: '', desc: '', old: { oldId, oldUsername: String(r.oldUsername || '').slice(0, 40), hubId, url, added: String(r.added || '').slice(0, 10) } }); created++;
if (!b.dry) store.addPacket({ owner: '', ownerName: null, status: 'dormant', stage: 'sprouting', name, url: '', desc: '', old: { oldId, oldUsername: String(r.oldUsername || '').slice(0, 40), hubId, url, added: String(r.added || '').slice(0, 10) } });
created++; // with dry: counted, nothing written (it used to write anyway)
}
return json(res, 200, { ok: true, created, skipped, dry: !!b.dry });
}