Conversation
…ls, contact pruning - New api/broadcasts/ blueprint + services/broadcasts_service.py (all routes volunteer.admin-gated), porting scripts/sync_resend_audience.py loaders: profiles, volunteers (type/event/selected), leads, Slack members, and contact_submissions filtered by inquiryType (+ receiveUpdates opt-in) - Segment sync runs as a daemon thread with redis status/lock (idempotent, create-only — never re-subscribes unsubscribed contacts); preview endpoint returns per-source counts + a contact-quota guardrail (RESEND_MARKETING_CONTACT_LIMIT, default 1000 = current free tier) - Broadcast create/send with server-enforced unsubscribe footer and a from-address allowlist (RESEND_BROADCAST_FROM / _FROM_DOMAINS, defaulting to notify.ohack.dev — notifs.ohack.org verification is partially failed) - POST /admin/broadcasts/batch-send: pre-personalized messages via resend.Batch.send in chunks of 100 (transactional quota), replacing the frontend's one-request-per-recipient loop; QR messages rejected per-recipient - Contact management for quota reclaim: full inventory endpoint + background prune job (modes: unsubscribed / emails / all) deleting GLOBAL contacts - userlist() in common/utils/slack.py is now redis-cached (10 min) above the rate limiter so varying active_days filters reuse one crawl; clear_slack_cache() clears the new prefix - Segment/contact/broadcast ops require RESEND_API_KEY (no send-only-key fallback); everything is ENVIRONMENT=test-gated and Slack-audited - Tests: api/broadcasts/tests/test_broadcasts_service.py (36 cases) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resend broadcasts: segment sync, one-call mass email, batch sends, contact pruning
Every judge application with anything typed in "Additional availability
details" fired an ERROR ("CRITICAL: All patterns failed to match slot",
Sentry 80f5bb179a23474d843391277adf62ba) plus two WARNINGs. The .ics
calendar-attachment parser only understands the machine-generated slot
format the mentor/volunteer forms emit; the judge form's availability is
deliberately free text, so it failed all three patterns on every submit.
The request itself always succeeded — this was pure log noise.
- Early guard: availability with no "Weekday, Mon D" structured prefix
logs INFO and returns [] (free text is expected input, not an error)
- Genuine structured-parse failures now log one WARNING per slot
(was ERROR with a char-code dump); per-pattern cascade logs are DEBUG
- Call-site "no calendar attachments generated" downgraded to INFO
- Tests: free-text skip (the exact Sentry string) + structured
two-slot regression
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…sentry-noise Stop Sentry noise: judge free-text availability isn't a parse error
| if not raw: | ||
| return None | ||
| e = str(raw).strip().lower() | ||
| return e if EMAIL_RE.match(e) else None |
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.
No description provided.