Reverse registry sync: LinkSpin-first members arrive on InstantAdPay as waiting accounts
POST /api/partner/registry (same HMAC LS_SYNC_SECRET scheme LinkSpin accepts from us, 10-minute window) feeds lsinbound.js: an email already on InstantAdPay keeps its sponsor and only gets empty fields filled (username if free and allowed, wallet if no other account or linked position holds it, profile); a new email becomes a waiting shell (joinedVia linkspin) under its LinkSpin sponsor, building the sponsor's shell upward from known rows (25 levels), remembering a sponsor whose row has not arrived and binding it later, refusing sponsor loops. No mail, notices or chain. Unclaimed shells are left out of accounts.listAll by default (tank, coach nudges, Friday/Wednesday broadcasts, member update audiences, leaderboard, 1,000-member milestone count); the admin members table and lssync ask for them. The first sign-in claims the shell: the sign-up anti-fraud checks run then, a sponsorless shell takes the link used, lastSeen set. Loop guard: lssync mutes an email while its LinkSpin row is applied, then records the result as already pushed when it equals what LinkSpin sent; touch() now skips rows whose hash is unchanged. Status: GET /api/admin/lsinbound (also under /api/admin/lssync as inbound). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+6
-2
@@ -469,7 +469,11 @@ async function linkWallet(email, address) {
|
||||
async function count() { return impl().count(); }
|
||||
// admin: newest-first account list, and re-pointing a member's sponsor (a
|
||||
// username, share code, or numeric member id: the same tokens join links use)
|
||||
async function listAll(limit = 500) { return impl().listAll(limit); }
|
||||
// A waiting account made from a LinkSpin registry row (lsinbound.js, 2026-10-15) that its owner has not signed in to yet.
|
||||
// It exists so the LinkSpin line is already in place; it is not a member yet, so the sweeps that mail, count or adopt
|
||||
// members (listAll by default) leave it out. It becomes an ordinary account the first time its owner signs in (lastSeen).
|
||||
const isUnclaimedShell = a => !!a && a.joinedVia === 'linkspin' && !a.lastSeen && !a.memberId;
|
||||
async function listAll(limit = 500, opts) { const all = await impl().listAll(limit); return opts && opts.shells ? all : all.filter(a => !isUnclaimedShell(a)); }
|
||||
async function identities() { return impl().identities(); }
|
||||
async function setSponsorRef(email, ref) { const r = await impl().setSponsorRef(normEmail(email), String(ref || '').trim().toLowerCase().slice(0, 40)); if (r && !r.error) changed(normEmail(email)); return r; }
|
||||
|
||||
@@ -495,7 +499,7 @@ async function getChatSettings(email) {
|
||||
return { available: a ? a.chatAvailable !== false : true, mutes: await impl().getMutes(String(email || '').toLowerCase()) };
|
||||
}
|
||||
|
||||
module.exports = { init, signup, login, ensure, onChange, byEmail, byAddress, byCode, byUsername, byMemberId: id => impl().byMemberId(Number(id) || 0), listAll, identities, setSponsorRef,
|
||||
module.exports = { init, signup, login, ensure, onChange, isUnclaimedShell, byEmail, byAddress, byCode, byUsername, byMemberId: id => impl().byMemberId(Number(id) || 0), listAll, identities, setSponsorRef,
|
||||
setUsername, reservedUsername, setMemberId, namesForMembers, listByReferrer, downline, linkWallet, count,
|
||||
setLineBanner: (e, b, t) => impl().setLineBanner(String(e || '').toLowerCase(), b, t),
|
||||
setWallOffers: (e, j) => impl().setWallOffers(String(e || '').toLowerCase(), j),
|
||||
|
||||
Reference in New Issue
Block a user