Skip to content

perf(server): #88 bulk DB loops + React.cache#91

Merged
f-amine merged 1 commit into
masterfrom
perf/88-server-loops
May 15, 2026
Merged

perf(server): #88 bulk DB loops + React.cache#91
f-amine merged 1 commit into
masterfrom
perf/88-server-loops

Conversation

@f-amine
Copy link
Copy Markdown
Owner

@f-amine f-amine commented May 15, 2026

Closes #88. inArray bulk fetch, Promise.all in 4 hot loops, React.cache on hasCompletedOnboarding. Also fixes a latent bug in GDPR purge where the cascade wiped the row before the purgedAt update committed.

Closes #88.

- affiliate.topReferrers: replace per-row SELECT with single inArray
  + Map lookup; also drops the buggy stub 'satisfy and() arity' query
  that was always one-row and discarded
- gdpr.purgeExpiredDeletions: parallelize the markPurgedAt + audit
  insert per row, and reorder so we mark+audit BEFORE the user delete
  (previously the cascade wiped accountDeletion before the update,
  making the purgedAt write a silent no-op)
- referral.recordAcceptance: Promise.all the update + audit per row,
  iterations themselves via Promise.allSettled
- webhooks.processPendingDeliveries: parallelize the two status
  updates per delivery (delivery row + subscription row)
- onboarding.hasCompletedOnboarding: wrap in React.cache so the
  layout + page no longer double-query per request
@f-amine f-amine merged commit fae5f22 into master May 15, 2026
2 checks passed
@f-amine f-amine deleted the perf/88-server-loops branch May 15, 2026 15:23
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.

perf(server): bulk DB loops + React.cache repeated queries

1 participant