Hub activity from every signed-in LinkSpin use (Marty 2026-11-16: "LinkSpin never reports activity", DownlineHydra Wake it)
The page-load ping (networksso.page) only fires on a full top-level navigation with Sec-Fetch-Dest: document and a
member session that carries an email. It never fired for a Control Room tab kept open (client-side moves and the
/api/my/ping heartbeat), browsers that send no Sec-Fetch headers, wallet-only sessions, or the owner working in the
admin portal. Live finding: Marty has had no LinkSpin member session since 2026-11-15 20:20 UTC, before the ping
shipped (b2669cf, 21:36 UTC); 16 other members already had linkspin rows.
- networksso.seen(s): the same once-a-day ping for any signed-in request; called from /api/me (email or wallet),
the dashboard heartbeat /api/my/ping and the admin portal page (/admin, the owner's email; hub activity only,
the admin session is never shared).
- qa/networksso-activity.test.mjs (13 checks, real hub, in run.sh sso + member): a signed-in page load records
site linkspin, once a day, never API/assets/bots/fetches/signed-out, seen() for an open tab and a wallet session.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2127,6 +2127,7 @@ const server = http.createServer(async (req, res) => {
|
||||
if (!s) return json(res, 200, { signedIn: false });
|
||||
const memberId = await auth.refreshMemberId(s);
|
||||
let acct = (s.email && await accounts.byEmail(s.email)) || (s.address && await accounts.byAddress(s.address)) || null;
|
||||
networksso.seen({ email: s.email || (acct && acct.email) || null, address: s.address || null }); // the hub's daily activity (DownlineHydra "Wake it"), once a day
|
||||
// Who the member sees as their sponsor (2026-11-02, Orlando saw a stranger): a member who is on the chain shows the sponsor the
|
||||
// contract bound, never the referral cookie from the last link they clicked; the cookie only speaks for accounts not on chain yet.
|
||||
let spdMe = await sponsorByChain(acct && acct.memberId); if (!spdMe) spdMe = await resolveSponsorDetailed((acct && acct.sponsorRef) || (!(acct && Number(acct.memberId) > 0) ? parseCookies(req)['iap.sponsor'] : '')); let sponsorId = spdMe.id;
|
||||
@@ -3580,7 +3581,7 @@ const server = http.createServer(async (req, res) => {
|
||||
if (p === '/api/my/ping' && req.method === 'GET') {
|
||||
const s = await auth.fromRequest(req);
|
||||
if (!s || !s.email) return json(res, 200, { ok: true, chatUnread: 0 });
|
||||
accounts.touchSeen(s.email).catch(() => {});
|
||||
accounts.touchSeen(s.email).catch(() => {}); networksso.seen(s); // a tab kept open: still one hub activity ping a day
|
||||
return json(res, 200, { ok: true, chatUnread: await messages.chatUnread(s.email) });
|
||||
}
|
||||
// training center content (admin-curated via data/training.json)
|
||||
@@ -4559,7 +4560,7 @@ const server = http.createServer(async (req, res) => {
|
||||
if (p === '/help') return sendFile(res, path.join(PUBLIC_DIR, 'help.html')); // Control Room: Help, the member's support tickets (2026-10-16)
|
||||
if (p === '/support' || /^\/support\/t\/[A-Za-z0-9_.-]{20,80}$/.test(p)) return sendFile(res, path.join(PUBLIC_DIR, 'support.html')); // public form + private ticket link, open past the curtain
|
||||
if (p === '/join') return serveJoinPage(res, '', '', null, []); // bare join: sponsor from the cookie if any (home-page CTAs)
|
||||
if (p === '/admin') return sendFile(res, path.join(PUBLIC_DIR, 'admin.html'));
|
||||
if (p === '/admin') { const adm = adminFromRequest(req); if (adm && adm.email) networksso.seen({ email: adm.email }); return sendFile(res, path.join(PUBLIC_DIR, 'admin.html')); } // the owner working in the admin portal is using LinkSpin too (hub activity only; the admin session is never shared)
|
||||
if (p === '/shorts') return sendFile(res, path.join(PUBLIC_DIR, 'shorts.html'));
|
||||
if (p === '/plays') return sendFile(res, path.join(PUBLIC_DIR, 'plays.html'));
|
||||
if (p === '/partners') return sendFile(res, path.join(PUBLIC_DIR, 'partners.html')); // site-owner kit (Marty, 2026-09-12)
|
||||
|
||||
Reference in New Issue
Block a user