Repository navigation
perf(backend): batch digest and push writes, read in parallel, share parsers, delete dead code - #2444
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Nov 10, 2026 in 2m 39s
Confidence 10/10 · No issues found
🟢 Confidence 10/10 · safe to merge. Batched writes and the org purge are pinned by new PGlite tests; the three concurrency edits only reorder independent reads. (The kickoff's "changed since then" list named files this diff does not con…
no findings · tests covered · risk high
Batches the daily membership sweep and the device push stamp into multi-row writes, runs three groups of independent reads concurrently, and purges fix-verification rows with the org. The new writes and the purge are exercised by tests; no correctness, scoping or data-loss defect found.
reconcileSubscriptionsupserts 500 members at a time, deduped by (org, user)markPushedstamps every device id in oneIN (...)UPDATEErrorIssueVerificationsmoves into the org-delete purgegetBearerTokenandparseIngestKeyEncryptionKeycollapse to one copy each
Production impact
Production traffic of the changed files (last 7 days)
| File | Calls/day | Busiest operations |
|---|---|---|
packages/backend/src/services/digest/DigestService.ts |
1.4k | Clerk.organizations.getOrganizationMembershipList 1.2k/day, 0.0% errClerk.organizations.getOrganizationMembershipList 141/day, 0.0% err |
packages/backend/src/services/integrations/scrape-check-retention.ts |
76 | ScrapeCheckRetention.pruneForTargets 76/day, 0.0% err |
What was checked
- Dedup keyed
${orgId}:${userId}in aMap, so the last entry wins and no statement touches a row twice (DigestService.ts:962) markPushedkeepsorgIdin theWHERE; the new test pins a foreign device id leaving its row untouched- Deleted
alert-templates/,captureReusableContextand the two GitHub types have no remaining references at the head
0d1d10a · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading