Quiet hub accounts (Marty 2026-11-14, join one = join all): accounts the hub makes here get joinedRef 'hub', and accounts.listAll leaves out hub-made accounts that never signed in unless { shells: true }, so no mailing or sweep (updates 'all', launch week, coach, leaderboard) reaches them. hubsync/launchweek/sponsorfollow/tank-cap tests pass

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-14 09:10:11 -06:00
parent 42cbe96979
commit fb84d1545d
3 changed files with 11 additions and 3 deletions
+5 -1
View File
@@ -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)
+2 -1
View File
@@ -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) {
+4 -1
View File
@@ -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);