Holding tank: 24-hour sign-up grace plus a Who invited you card (Marty 2026-11-07: "24-hour grace plus the prompt"). On Nov 2 a sponsorless sign-up was adopted five hours after joining, before he could say who invited him.
Grace: for 24 hours from an account's created time nobody can adopt the person by hand. They stay on the waiting list after the open ones with an Opens in badge and no Adopt button, and adopt() refuses in plain words. Only sign-up counts, so someone back in the tank later has no grace. Auto-assign does not wait for it: the 24-hour hold still runs from the wallet link and is not stretched. No notice tells people to adopt someone they cannot adopt yet: the wallet-ready post waits for the grace and says the time really left, is skipped when the rotation takes them in that tick, the arrivals post moves to when the grace ends (marks.claim per member), and the Overview note and weekly email count only people who are open. Prompt: a member with no sponsor and no member number sees the card at the top of Overview, types a username, confirms in an in-page box, and that person becomes their sponsor through setSponsor as a deliberate change with by 'invited', so it follows to LinkSpin and clears the hold. Refused: self, unknown username, already sponsored, member number or wallet already on the contract, a chain loop, a suspended sponsor, a no-payout chain, and a line with nobody on the contract (they would walk up to the company). The network sponsor is tried first. Nobody invited me hides it and a small link brings it back. Not an adoption: status 'invited', no 7-day window, not counted toward the two. The named sponsor gets the referral email and an on-site notice. Switch-on-payouts reminders track the named sponsor. Chatbot canned + systemPrompt, KNOWLEDGE_DATE 2026-11-07. my.js, admin.js, admin-sponsorcheck.js ?v=20261107tg. qa/tank-hold.mjs, qa/sponsorfollow.test.cjs and qa/sponsorfollow-e2e.mjs extended (SF_E2E_PORT overrides the ports). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1512,7 +1512,11 @@ async function tankNotifyTick() {
|
||||
const f = path.join(DATA_DIR, 'tank-notify.json');
|
||||
let st = { last: 0 }; try { st = JSON.parse(fs.readFileSync(f, 'utf8')); } catch (e) {}
|
||||
const since = st.last || (Date.now() - 24 * 3600 * 1000);
|
||||
const fresh = (await tank.waiting()).filter(w => (w.joined || 0) > since);
|
||||
// sign-up grace (2026-11-07): announced when they can be adopted, 24 hours after sign-up, not when they arrive. graceFrom =
|
||||
// the first run of this rule: anyone who joined before it was already announced at sign-up.
|
||||
const graceFrom = st.graceFrom || (st.graceFrom = st.last || Date.now());
|
||||
const fresh = [];
|
||||
for (const w of tank.openedSince(await tank.waiting(), since)) if ((w.joined || 0) > graceFrom && await marks.claim('tankopen:' + w.email + ':' + (w.joined || 0))) fresh.push(w);
|
||||
st.last = Date.now(); fs.writeFileSync(f, JSON.stringify(st));
|
||||
if (!fresh.length) return;
|
||||
const named = fresh.filter(w => w.username).map(w => '@' + w.username);
|
||||
@@ -1555,11 +1559,11 @@ async function tankReadyTick() {
|
||||
// linked" with the last sign-in, so adopters can judge (Marty 2026-10-29: the old wording read as a live member)
|
||||
const seen = ms => { try { return new Date(ms).toLocaleDateString('en-US', { month: 'short', day: 'numeric', timeZone: 'America/Chicago' }); } catch (e) { return ''; } };
|
||||
for (const w of r.fresh) await telegramSend(sc.telegramEchoChatId, '\u{1F7E2} ' + (w.username ? '@' + clean(w.username) : 'A new member')
|
||||
+ (w.linkedNow ? ' linked a wallet and is ready to switch on payouts. Adopt them from the holding tank in the next 24 hours: '
|
||||
: ' is in the holding tank with a wallet already linked' + (w.lastSeen ? ' (last seen ' + seen(w.lastSeen) + ')' : '') + '. Adopt them in the next 24 hours: ') + link, sc.telegramEchoTopicId).catch(() => {});
|
||||
+ (w.linkedNow ? ' linked a wallet and is ready to switch on payouts. Adopt them from the holding tank in the next ' + tank.leftText(w.until - Date.now()) + ': '
|
||||
: ' is in the holding tank with a wallet already linked' + (w.lastSeen ? ' (last seen ' + seen(w.lastSeen) + ')' : '') + '. Adopt them in the next ' + tank.leftText(w.until - Date.now()) + ': ') + link, sc.telegramEchoTopicId).catch(() => {});
|
||||
} else { // first run after deploy (the members already linked) or a busy quarter hour: one digest, not a wall of posts
|
||||
const named = r.fresh.filter(w => w.username).map(w => '@' + clean(w.username));
|
||||
await telegramSend(sc.telegramEchoChatId, '\u{1F7E2} ' + r.fresh.length + ' members in the holding tank have a wallet linked and are ready to switch on payouts' + (named.length ? ': ' + named.slice(0, 12).join(', ') + (named.length > 12 ? ' and ' + (named.length - 12) + ' more' : '') : '') + '. Adopt them from the holding tank in the next 24 hours: ' + link, sc.telegramEchoTopicId).catch(() => {});
|
||||
await telegramSend(sc.telegramEchoChatId, '\u{1F7E2} ' + r.fresh.length + ' members in the holding tank have a wallet linked and are ready to switch on payouts' + (named.length ? ': ' + named.slice(0, 12).join(', ') + (named.length > 12 ? ' and ' + (named.length - 12) + ' more' : '') : '') + '. Adopt them from the holding tank in the next ' + tank.leftText(Math.min(...r.fresh.map(w => w.until)) - Date.now()) + ': ' + link, sc.telegramEchoTopicId).catch(() => {});
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@@ -2934,6 +2938,7 @@ const server = http.createServer(async (req, res) => {
|
||||
const out = { signedIn: true, gkShop: !!parseCookies(req)['iap.gkshop'], sdShop: !!parseCookies(req)['iap.sdshop'], pwMint: !!parseCookies(req)['iap.pwmint'], returnTo: ['turkeydrop', 'polhunter', 'driprunner', 'passivedrip', 'gemkingdom', 'gkshop', 'spookydoors', 'sdshop', 'pwmint', 'polybreak', 'polminer', 'warpwares', 'shardsofvalor'].includes(parseCookies(req)['iap.return']) ? parseCookies(req)['iap.return'] : null, sponsorBlocked, sponsorRouted, sponsorName: spdMe.name || null, email: s.email || (acct && acct.email) || null,
|
||||
address: s.address || (acct && acct.address) || null, memberId,
|
||||
username: (acct && acct.username) || null, theme: (acct && acct.theme) || null,
|
||||
inviteAsk: !memberId && acct ? tank.inviteAsk(acct) : null, // the Who invited you card (2026-11-07)
|
||||
refCode: (acct && acct.code) || null, sponsorId, tankHold, sponsorFallback,
|
||||
// profile + line-banner fields so the Profile pane repopulates on reload (were being saved but not returned)
|
||||
avatarUrl: (acct && acct.avatarUrl) || null, bio: (acct && acct.bio) || null,
|
||||
@@ -2964,7 +2969,7 @@ const server = http.createServer(async (req, res) => {
|
||||
let tankWaiting = null; // top of every Overview: people waiting for a sponsor (Marty, 2026-09-12)
|
||||
try {
|
||||
if (!tankWaitCache || Date.now() - tankWaitCache.ts > 60000) tankWaitCache = { ts: Date.now(), list: await tank.waiting() };
|
||||
const tw = tankWaitCache.list;
|
||||
const tw = tank.adoptableOf(tankWaitCache.list); // only people who can be adopted right now (sign-up grace, 2026-11-07)
|
||||
tankWaiting = { count: tw.length, names: tw.slice(0, 6).map(w => w.name), eligible: !!(await tank.eligibility(s.email)).ok, ready: tw.filter(w => w.ready).length };
|
||||
} catch (e) {}
|
||||
const sc0 = siteConfig();
|
||||
@@ -3457,6 +3462,19 @@ const server = http.createServer(async (req, res) => {
|
||||
}
|
||||
return json(res, r.error ? 400 : 200, r);
|
||||
}
|
||||
// "Who invited you?" (Marty approved 2026-11-07): the signed-in member names their own sponsor. check: validate only.
|
||||
if (p === '/api/my/tank/invited' && req.method === 'POST') {
|
||||
const s = await auth.fromRequest(req);
|
||||
if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
|
||||
const b = await readBody(req);
|
||||
const r = await tank.nameSponsor(s.email, b.who, { check: !!b.check });
|
||||
return json(res, r.error ? 400 : 200, r);
|
||||
}
|
||||
if (p === '/api/my/tank/invited/dismiss' && req.method === 'POST') { // "Nobody invited me": hides the card, nothing else changes
|
||||
const s = await auth.fromRequest(req);
|
||||
if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
|
||||
return json(res, 200, tank.dismissInvite(s.email));
|
||||
}
|
||||
if (p === '/api/my/tank/release' && req.method === 'POST') {
|
||||
const s = await auth.fromRequest(req);
|
||||
if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
|
||||
|
||||
Reference in New Issue
Block a user