Referral gate fails closed: a broken setting pays nobody

The rule is that a bounty is only ever earned by somebody who did not exist in
InstantAdPay before the mission did. The check was written so that an absent or
unparseable refNewAfter meant "no floor, pay everyone", which is the same shape
as the rolling window that paid 8.67 POL for members who already existed.

Now a blank, mistyped, zero or missing floor pays nobody at all, and so does a
member with no InstantAdPay join date on file. The gate can only ever be opened
on purpose.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-23 11:36:59 -05:00
parent cca90bdd00
commit d04474fd7b
+8 -3
View File
@@ -122,9 +122,14 @@ function onFind(member, find) {
let room = Number(c.refCapPol) - paidRefToday(); let room = Number(c.refCapPol) - paidRefToday();
const ageDays = me.joinedAt ? (Date.now() - Number(me.joinedAt)) / 86400000 : 0; const ageDays = me.joinedAt ? (Date.now() - Number(me.joinedAt)) / 86400000 : 0;
// the floor: did this person exist before the mission did? // the floor: did this person exist before the mission did?
const floor = Date.parse(String(c.refNewAfter || '')) || 0; // This gate FAILS CLOSED and must stay that way. No floor configured, a blank or mistyped
const isNew = !floor || (me.joinedAt && Number(me.joinedAt) >= floor); // date, or a member with no InstantAdPay join date on file: nobody gets paid. The last version
if (!isNew) return []; // an existing member hunting earns their sponsor nothing, ever // of this line paid out whenever the setting did not exclude anyone, which is how 8.67 POL went
// to sponsors of members who already existed. A referral only counts if the person did not
// exist in InstantAdPay before the mission did.
const floor = Date.parse(String(c.refNewAfter || ''));
if (!Number.isFinite(floor) || floor <= 0) return [];
if (!me.joinedAt || Number(me.joinedAt) < floor) return [];
const who = { forMemberId: id, forName: me.username || ('#' + id) }; const who = { forMemberId: id, forName: me.username || ('#' + id) };
// the bounty, once, on their first find, and only while they are genuinely a new member // the bounty, once, on their first find, and only while they are genuinely a new member