Member erase (Marty 2026-11-15, ticket LS-1021): POST /api/admin/erase {email, dryRun (default true), force} + the hub's member.erased event

erase.js runs inside the app so the documents modules keep in memory and the MySQL docs rows stay consistent. Refused
unless force: a main wallet, an on-chain member number, positions, a team here, ads running or queued. Removes the
account, their spin links with every click row in rot_hits and conversions (rotator.eraseOwner, docstore.rowsWhere),
and scrubs every document that mentions them with scrub.js (same file as InstantAdPay) through the owning module's live
copy: accounts, audiences, coach, convtrack, earned (unspent credits go away), hubsync, iapsync, mail-intro, postbacks,
registry, rotator, sponsorfollow; others (updates-log, ...) through docstore. A 30-day email-hash tombstone (erase.json)
stops the InstantAdPay registry sync and hub events from bringing them back; the log keeps hashes and counts only.
hubsync handles member.erased {emailHash}. qa/erase.test.cjs 6 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-15 12:29:33 -06:00
parent e2af298317
commit f4789156b8
18 changed files with 349 additions and 14 deletions
+1 -1
View File
@@ -77,4 +77,4 @@ function sendCode(to, code) {
+ 'LinkSpin\nAdvertise and earn instantly. Locked in code, not promises.\n' + SITE_URL, { code: true });
}
module.exports = { init, hasKey, send, sendCode };
module.exports = { init, hasKey, send, sendCode, /* member erase (erase.js, 2026-11-15): the live copy */ _intro: { state: () => introLoad(), save: () => { try { fs.writeFileSync(introFile() + '.tmp', JSON.stringify(introLoad())); fs.renameSync(introFile() + '.tmp', introFile()); } catch (e) {} } } };