diff --git a/accounts.js b/accounts.js index 418670a..afa635e 100644 --- a/accounts.js +++ b/accounts.js @@ -470,7 +470,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); } +// QUIET (Marty 2026-11-14, "join one = join all"): a waiting account the network hub made here (carried, joinedRef 'hub') that has never +// signed in is left out of every list by default, so no sweep or mailing (updates, launch week, coach, leaderboard) reaches +// someone who never chose LinkSpin. { shells: true } includes them (spam scan, sponsor follow). Same rule as InstantAdPay's. +const isHubShell = a => !!a && a.joinedVia === 'carried' && a.joinedRef === 'hub' && !a.lastSeen && !a.memberId; // made by hubsync.js +async function listAll(limit = 500, opts) { if (opts && opts.shells) return impl().listAll(limit); const all = await impl().listAll(Math.max(limit, 1e7)); return all.filter(a => !isHubShell(a)).slice(0, limit); } async function setSponsorRef(email, ref) { return impl().setSponsorRef(normEmail(email), String(ref || '').trim().toLowerCase().slice(0, 40)).then(tap(normEmail(email))); } // resolve a member's DIRECT sponsor account (the token they joined under) diff --git a/hubsync.js b/hubsync.js index 11241f3..b1a4612 100644 --- a/hubsync.js +++ b/hubsync.js @@ -93,7 +93,8 @@ async function place(p, depth, seen) { try { await R.registry.upsert({ email: e, username: p.username || null, wallet: p.wallet || null, sponsorEmail: sp ? sp.email : null, joinedAt: p.firstDoor && p.firstDoor.at, firstProperty: (p.firstDoor && p.firstDoor.site) || 'network' }); } catch (err) {} } let a = await R.accounts.byEmail(e); - if (!a) { const x = await R.accounts.ensure(e, '', 'carried', 'network'); if (x.created) { const st = load(); st.stats.shells++; st.made[e] = (p.firstDoor && p.firstDoor.site) || 'network'; } a = await R.accounts.byEmail(e); } + // joinedRef 'hub' (2026-11-14): a quiet waiting account the hub made; accounts.listAll leaves it out of every mailing until they sign in + if (!a) { const x = await R.accounts.ensure(e, '', 'carried', 'hub'); if (x.created) { const st = load(); st.stats.shells++; st.made[e] = (p.firstDoor && p.firstDoor.site) || 'network'; } a = await R.accounts.byEmail(e); } if (!a) return null; if (p.username && !a.username) { try { const r = await R.accounts.setUsername(e, p.username); if (r && !r.error) load().stats.filled++; } catch (err) {} } if (sp && norm(sp.email) !== e) { diff --git a/qa/hubsync.test.cjs b/qa/hubsync.test.cjs index 3711ce7..de35e6e 100644 --- a/qa/hubsync.test.cjs +++ b/qa/hubsync.test.cjs @@ -73,7 +73,10 @@ const W = n => '0x' + String(n).padStart(40, '0'); await hooks.tick(); const ann = await accounts.byEmail(E('ann')), bob = await accounts.byEmail(E('bob')); assert.ok(ann && bob, 'shells created'); - assert.strictEqual(bob.joinedVia, 'carried'); assert.strictEqual(bob.joinedRef, 'network'); + assert.strictEqual(bob.joinedVia, 'carried'); assert.strictEqual(bob.joinedRef, 'hub'); + // quiet (2026-11-14): hub-made accounts that never signed in are out of every default list (mailings, sweeps), in with { shells: true } + assert.ok(!(await accounts.listAll(1000)).some(a => a.email === E('bob')), 'hub shell left out of default lists'); + assert.ok((await accounts.listAll(1000, { shells: true })).some(a => a.email === E('bob')), 'hub shell listed with shells: true'); assert.strictEqual(bob.username, 'bobby'); assert.strictEqual((await accounts.sponsorOf(E('bob'))).email, E('ann')); assert.strictEqual((await registry.get(E('bob'))).firstProperty, 'ctb'); assert.strictEqual(hubsync.adminView().stats.shells, 2);