Keep the notifications worth interrupting for
Splitting system messages out of the modal was right for payout receipts,
but it would have silenced two that a member genuinely loses money by
ignoring:
- "@someone is trying to buy. Link your wallet so it pays you" — a sale
is blocked right now, and the referral is lost permanently once it
routes to someone else.
- "You missed 43 POL on InstantAdPay" — a payout passed them by, and the
message explains exactly how to stop the next one doing the same.
So the dividing line is not system-versus-human, it is "does this need you
to do something". Those two become kind 'alert' and still interrupt; the
receipts stay kind 'notice' and stay in the inbox.
The modal no longer credits an alert to a person either. It was saying "A
message from @martbost" over machine-generated text, because system mail
is sent by member 1 at ADMIN_EMAIL. Alerts now read "Action needed on your
account".
Also reclassified "X is now in your line for good" as a notice — it is
good news about a referral the member gained, with nothing at stake.
qa/messages-notice.mjs now covers both lanes: 14 checks, including that an
alert interrupts and a flood of 25 receipts does not.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -240,10 +240,22 @@ async function bootstrap() {
|
||||
// Idempotent — after the first pass nothing matches.
|
||||
for (const like of ['You just got paid %POL on InstantAdPay',
|
||||
'You missed %POL on InstantAdPay',
|
||||
'%is trying to buy. Link your wallet so it pays you']) {
|
||||
'%is trying to buy. %',
|
||||
'You lost %payouts were not switched on%',
|
||||
'% is now in your line for good%']) {
|
||||
try { await q("UPDATE sponsor_messages SET kind='notice' WHERE kind='broadcast' AND subject LIKE ?", [like]); }
|
||||
catch (e) {}
|
||||
}
|
||||
// ...but two of those DO need the member to act, and they lose money by not acting: a sale
|
||||
// blocked or already lost because payouts are off, and a payout that passed them by. Those
|
||||
// keep interrupting. The dividing line is "does this need you to do something", not
|
||||
// "who sent it".
|
||||
for (const like of ['You missed %POL on InstantAdPay',
|
||||
'%is trying to buy. %',
|
||||
'You lost %payouts were not switched on%']) {
|
||||
try { await q("UPDATE sponsor_messages SET kind='alert' WHERE kind='notice' AND subject LIKE ?", [like]); }
|
||||
catch (e) {}
|
||||
}
|
||||
// per-account chat settings: availability toggle (default on) + muted-member list (JSON emails)
|
||||
await alterSafe('ALTER TABLE accounts ADD COLUMN chat_available TINYINT NOT NULL DEFAULT 1');
|
||||
await alterSafe('ALTER TABLE accounts ADD COLUMN chat_mutes VARCHAR(4000) NULL');
|
||||
|
||||
Reference in New Issue
Block a user