f6621a8e34
B2: the built-in page form posted an empty lsid (pt.js only filled .lsform, the pasted-form class), so page leads never
reached the rotator 'lead' conversion or the postback. The server now fills the hidden lsid at render from ?lsid or the
ls.click cookie, the lead POST falls back to the ls.click cookie when the form sends none, and pt.js fills both .ls-form
and .lsform as a fallback (cache tag pt.js?v=2). Pasted provider forms get no added field: some providers reject unknown
fields, so the lsid only rides along when the member's own form code has an lsid field.
B4: /p.gif now stores the pixel's e= event name (lowercase [a-z0-9_-]{1,32}) in a parallel ev map in audiences.json;
hits stay plain timestamps, so old rows count, match and prune as before. The audiences list shows counts by event
(events for cookie visitors, eventsSoft for 24 h soft keys).
B3: a pixel hit with no ls.vid cookie still offers the cookie but is counted under the 24 h IP + user agent key only,
not a fresh 30-day visitor id, so a cookie-blocking browser counts once.
Test: qa/lsid-pixel.test.mjs (bash qa/run.sh lsid), unit + local end to end on a throwaway data dir.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
53 lines
2.6 KiB
Bash
53 lines
2.6 KiB
Bash
#!/usr/bin/env bash
|
|
# InstantAdPay QA harness runner. From the site dir:
|
|
# bash qa/run.sh public # live public pages only (no local server)
|
|
# bash qa/run.sh member # local copy: member + admin walk
|
|
# bash qa/run.sh earn # local copy: earning flows end to end (~2-3 min)
|
|
# bash qa/run.sh all # public + member + earn
|
|
# bash qa/run.sh kb # chat knowledge base: retrieval unit test + chat endpoint e2e on a local copy with a mock OpenRouter
|
|
# bash qa/run.sh sponsorfollow # sponsor follow rule + network tank unit tests + carry hold guard
|
|
# bash qa/run.sh lsid # page-builder lead -> rotator conversion + postback, audience pixel events and cookieless hits
|
|
# Each local run boots server.js on its own port with a throwaway data dir (JSON store, no DB, no
|
|
# mail key, devCode sign-in), so nothing touches production data. Reports land in qa/out/.
|
|
set -u
|
|
cd "$(dirname "$0")/.."
|
|
MODE="${1:-all}"
|
|
OUT="qa/out"; mkdir -p "$OUT"
|
|
TMP="${TMPDIR:-${TEMP:-/tmp}}/iap-qa-$$"
|
|
status=0
|
|
|
|
start_local() { # $1 = port
|
|
local port="$1"
|
|
rm -rf "$TMP-$port"; mkdir -p "$TMP-$port/uploads"
|
|
(PORT="$port" DATA_DIR="$TMP-$port" ADMIN_EMAIL="${ADMIN_EMAIL:-martybostick@gmail.com}" ADMIN_PASSWORD=localtest node server.js > "$OUT/server-$port.log" 2>&1 &)
|
|
for i in $(seq 1 20); do curl -s -m 2 "http://127.0.0.1:$port/api/config" >/dev/null && return 0; sleep 1; done
|
|
echo "local server on :$port did not come up"; return 1
|
|
}
|
|
stop_local() { # $1 = port
|
|
for p in $(netstat -ano 2>/dev/null | grep ":$1 " | awk '{print $5}' | sort -u); do taskkill //F //PID "$p" >/dev/null 2>&1; done
|
|
rm -rf "$TMP-$1"
|
|
}
|
|
|
|
if [ "$MODE" = "public" ]; then
|
|
node qa/walk.mjs public || status=1
|
|
elif [ "$MODE" = "member" ]; then
|
|
start_local 8796 && { LOCAL=http://127.0.0.1:8796 node qa/walk.mjs member || status=1; }; stop_local 8796
|
|
elif [ "$MODE" = "sponsorfollow" ]; then
|
|
node qa/sponsorfollow.test.cjs || status=1
|
|
node qa/carry-hold.test.cjs || status=1
|
|
elif [ "$MODE" = "lsid" ]; then
|
|
node qa/lsid-pixel.test.mjs || status=1
|
|
elif [ "$MODE" = "kb" ]; then
|
|
node qa/kb-retrieval.cjs || status=1
|
|
node qa/kb-chat.mjs || status=1
|
|
elif [ "$MODE" = "earn" ]; then
|
|
start_local 8797 && { LOCAL=http://127.0.0.1:8797 node qa/earn.mjs || status=1; }; stop_local 8797
|
|
else
|
|
node qa/walk.mjs public || status=1
|
|
start_local 8796 && { LOCAL=http://127.0.0.1:8796 node qa/walk.mjs member || status=1; }; stop_local 8796
|
|
start_local 8797 && { LOCAL=http://127.0.0.1:8797 node qa/earn.mjs || status=1; }; stop_local 8797
|
|
fi
|
|
echo
|
|
echo "reports: $OUT/walk-report.txt $OUT/earn-report.txt (screenshots alongside)"
|
|
exit $status
|