In-file cleanup: host comms, admin mail, admin reports, data export (backend campaign 10) - #99
Closed
theobong wants to merge 5 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
A behavior-neutral cleanup inside the files of three areas: host broadcasts, announcements, analytics and exports; admin mail, inbound mail, discovery and jurisdictions; admin reports, users, moderation, activity, events, system health, analytics and the personal data export. The 900-line broadcast pipeline is split into lifecycle, in-app sender, email sender and audience modules, and the 400-line data export into a table of sections. Large functions are split into named helpers, repeated code is shared, magic values are named, and dead code and needless exports are removed. Nothing a user sees should change.
Before you start
Verify
Nothing new to verify: every step below is a regression check.
Regression
Host announcements and broadcasts — [Web] [Mobile]
Host analytics and exports — [Web] [Mobile]
Requesting your data — [Web] [Mobile]
Routing a report to the city — [Admin]
Moderation queue — [Admin]
Users, events and analytics — [Admin]
Findings addressed
Campaign PRs 7 to 10: the LOCAL DUP, READ and DEAD ledger findings for chunks B10 to B12, plus local magic values, large-function splits and un-exports.
Largest splits: the broadcast pipeline (656-line factory) into four modules with the same repository call order, kill checks, address dedupe and retry handling; the data export (
exportData, about 400 lines) into a section table with the same JSON key order, row caps, fit priority, redaction before fit and query order; outbound mail delivery; the jurisdiction directory listing; report routing and city follow-ups; the activity feed query builders.Decisions for the reviewer
round1of the ratio times 100). A comparison over 30 million ratios found no difference.commentssection of the data export (a product decision) and the "Phase 3" value on the admin routing tile (tests pin it).User-visible copy changes
None.
Tests changed
None. No test file was edited.
Verification
pnpm lint, prettier check,check:sqlclean; api unit suite by explicit path 428 files, 7116 passed, 3 skipped; media-worker unit 300 passed, 2 failed (the known arm64 ffprobe helper issue fixed in Backend test safety net: SQL transcripts, CSRF pairing, authz and characterization tests #92).as unknown as36 -> 34; non-null assertions 115 -> 106; swallowed catches 148 -> 143;anyunchanged at 6.Staging checks
https://api.civfix.dev/readyzanswers ready after the deploy (no migration in this PR).Not covered
🤖 Generated with Claude Code