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:
+35
-4
@@ -39,7 +39,35 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
|
||||
function tankHoldText(h) {
|
||||
let t = "You're being matched with a sponsor. Payouts switch on as soon as someone picks you up (within 24 hours).";
|
||||
if (h && h.until) { const ms = h.until - Date.now(); t += ms > 0 ? ' Time left: ' + holdLeft(ms) + '.' : ' Any minute now.'; }
|
||||
return t;
|
||||
return t + ' Did someone invite you? Tell us on your Overview.';
|
||||
}
|
||||
// "Who invited you?" card (Marty approved 2026-11-07): a member with no sponsor and no member number can name who invited
|
||||
// them. Soft: nothing else on the site waits for it, and "Nobody invited me" leaves a small link to bring it back.
|
||||
function paintInvite(me) {
|
||||
const c = $('inviteCard'), s = $('inviteSmall'); if (!c || !s) return;
|
||||
const ask = !me.memberId && me.inviteAsk;
|
||||
const small = !!(ask && ask.dismissed) && !paintInvite.reopened; // reopened from the small link: the next render must not close it under their fingers
|
||||
c.hidden = !ask || small; s.hidden = !small;
|
||||
}
|
||||
if ($('inviteGo')) {
|
||||
const say = (t, bad) => { const m = $('inviteMsg'); m.textContent = t || ''; m.style.color = bad ? 'var(--bad)' : ''; };
|
||||
const go = async () => {
|
||||
say('');
|
||||
try {
|
||||
const who = $('inviteWho').value;
|
||||
const chk = await api('/api/my/tank/invited', { who, check: true });
|
||||
if (!(await IAP.confirmBox(chk.name + ' becomes your sponsor. Your sponsor locks on the contract the first time you switch on payouts or buy, so check this is the right person.', { title: 'Who invited you?', ok: 'Yes, ' + chk.name, cancel: 'Not them' }))) return;
|
||||
const r = await api('/api/my/tank/invited', { who });
|
||||
$('inviteCard').hidden = true; IAP.status(r.name + ' is now your sponsor.', 'ok'); render();
|
||||
} catch (e) { say(e.message, true); }
|
||||
};
|
||||
$('inviteGo').addEventListener('click', go);
|
||||
$('inviteWho').addEventListener('keydown', e => { if (e.key === 'Enter') { e.preventDefault(); go(); } });
|
||||
$('inviteNo').addEventListener('click', async () => {
|
||||
try { await api('/api/my/tank/invited/dismiss', {}); } catch (e) {}
|
||||
paintInvite.reopened = false; $('inviteCard').hidden = true; $('inviteSmall').hidden = false;
|
||||
});
|
||||
$('inviteBack').addEventListener('click', e => { e.preventDefault(); paintInvite.reopened = true; $('inviteSmall').hidden = true; $('inviteCard').hidden = false; $('inviteWho').focus(); });
|
||||
}
|
||||
// one-tap switch on payouts (2026-10-27): the tank assignment chat + emails link to /my?activate=1#wallet. The intent
|
||||
// survives the sign-in and the wallet link (memory + sessionStorage) and runs the Activate button's own flow once.
|
||||
@@ -928,6 +956,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
|
||||
if (!render.gating) { render.gating = true; showOnboard(true).then(() => { render.gating = false; render(); }); }
|
||||
return;
|
||||
}
|
||||
paintInvite(me);
|
||||
// came from a Drip Runner share link: once they have a username, straight back into the game (2026-09-30)
|
||||
if (me.returnTo === 'driprunner' && !render.toGame) { render.toGame = true; location.href = '/api/my/driprunner'; return; }
|
||||
if (me.returnTo === 'gemkingdom' && !render.toGame) { render.toGame = true; location.href = '/api/my/gemkingdom'; return; } // Gem Kingdom sent them here to sign in (2026-10-01)
|
||||
@@ -1900,14 +1929,16 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
|
||||
} catch (e) {}
|
||||
}
|
||||
function renderTank(el, r) {
|
||||
const rows = listApply('tank', r.waiting).sort((a, b) => (b.ready ? 1 : 0) - (a.ready ? 1 : 0)); // ready to activate always on top (stable: the chosen order stays inside each group)
|
||||
const opens = w => w.opensAt > Date.now(); // new sign-up: they have 24 hours to say who invited them
|
||||
const opensBadge = w => ' <span class="badge amber" title="New member. They have 24 hours from sign-up to tell us who invited them. You can adopt them after that.">Opens in ' + holdLeft(w.opensAt - Date.now()) + '</span>';
|
||||
const rows = listApply('tank', r.waiting).sort((a, b) => (opens(a) ? 1 : 0) - (opens(b) ? 1 : 0) || (b.ready ? 1 : 0) - (a.ready ? 1 : 0)); // ready to activate always on top, the sign-up grace ones last (stable: the chosen order stays inside each group)
|
||||
el.innerHTML = '';
|
||||
el.appendChild(listBar('tank', r.waiting.length, rows.length, () => renderTank(el, r), { hide: ['payouts'] })); // nobody in the tank has payouts on
|
||||
const readyBadge = w => w.ready ? ' <span class="badge" style="background:var(--ok-soft);border-color:var(--ok);color:var(--ok)" title="Wallet linked. If nobody adopts them, the site assigns them to the next eligible adopter when the time runs out.">Ready to activate \u00b7 ' + (w.holdUntil > Date.now() ? holdLeft(w.holdUntil - Date.now()) + ' left' : 'assigning now') + '</span>' : '';
|
||||
el.insertAdjacentHTML('beforeend', rows.length ? rows.map(w => '<div class="lin-row"><span class="nm">' + esc(w.name) + readyBadge(w) + '</span>'
|
||||
el.insertAdjacentHTML('beforeend', rows.length ? rows.map(w => '<div class="lin-row"><span class="nm">' + esc(w.name) + (opens(w) ? opensBadge(w) : readyBadge(w)) + '</span>'
|
||||
+ '<span class="em">joined ' + ago(w.joined) + '<span class="sp wrap">' + memberChips(w) + '</span></span>'
|
||||
+ '<span class="dt">last sign-in: <b>' + ago(w.lastSeen) + '</b></span>'
|
||||
+ (r.eligible ? '<button class="btn small" type="button" data-adopt="' + esc(w.username || w.email) + '" data-aname="' + esc(w.name) + '">Adopt</button>' : '') + '</div>').join('')
|
||||
+ (r.eligible && !opens(w) ? '<button class="btn small" type="button" data-adopt="' + esc(w.username || w.email) + '" data-aname="' + esc(w.name) + '">Adopt</button>' : '') + '</div>').join('')
|
||||
: '<p class="muted small">Nobody in the tank matches those filters.</p>');
|
||||
pageList('tank', el, ':scope > .lin-row', { per: LINE_PER });
|
||||
el.querySelectorAll('[data-adopt]').forEach(b => b.addEventListener('click', async () => {
|
||||
|
||||
Reference in New Issue
Block a user