Skip to content

fix(affiliate): address post-merge Codex P2s on #568/#569#571

Merged
san-npm merged 1 commit into
mainfrom
fix/affiliate-codex-p2
Jun 12, 2026
Merged

fix(affiliate): address post-merge Codex P2s on #568/#569#571
san-npm merged 1 commit into
mainfrom
fix/affiliate-codex-p2

Conversation

@san-npm

@san-npm san-npm commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Two post-merge Codex P2 review comments on the referred-volume work (#568/#569).

1. Lifetime referee scan on the public regular path (#569)

getReferrerStats moved the cycle window from the JOIN into a FILTER so the same pass could also SUM lifetime volume. Side effect: every public, rate-limited /affiliate/:wallet request now joined a regular referrer's entire post-bound trade history, even though the regular UI only ever shows the current-cycle figure.

Fix: branch the query on kind (already computed two lines above):

Latent today (no affiliate has referees yet) but a real regression as referees accumulate.

2. AbortSignal.timeout unsupported on older targets (#568)

The production browserslist still includes iOS Safari 15.x (npx browserslist --env=productionios_saf 15.6-15.8), which lacks AbortSignal.timeout. The helper called it unconditionally, so it threw before fetch on those browsers — the signed partner-dashboard / code-creation / bind POSTs never left the device and showed as network failures.

Fix: feature-detect AbortSignal.timeout; fall back to AbortController + setTimeout (same abort-after-timeout behaviour) when absent.

Verify

🤖 Generated with Claude Code

1. Lifetime referee scan on the public regular path (#569).
   getReferrerStats moved the cycle window from the JOIN into a FILTER so it
   could also SUM lifetime, which made every public, rate-limited
   /affiliate/:wallet request scan a regular referrer's full post-bound trade
   history even though the regular UI only displays the current-cycle figure.
   Branch the query on kind: regular keeps the cycle-bounded JOIN (scans only
   this cycle); partners get the widened lifetime scan they actually display.

2. AbortSignal.timeout unsupported on older targets (#568). The production
   browserslist still includes iOS Safari 15.x, which lacks
   AbortSignal.timeout; the helper threw before fetch ran, surfacing the
   signed partner-dashboard / code-creation / bind POSTs as network failures.
   Feature-detect and fall back to AbortController + setTimeout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@san-npm san-npm merged commit f332cc0 into main Jun 12, 2026
18 checks passed
@san-npm san-npm deleted the fix/affiliate-codex-p2 branch June 12, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant