Conversation
…nsubscribe (#73) - SMTP env-driven config: empty = disabled, SMTP_DRIVER=log for dev/CI, partial config = fail-fast at startup - Minimal SMTP client (STARTTLS + AUTH) built on tokio-rustls - Events: comment.created + post.status_changed -> post author + commenters (actor excluded), fired via tokio::spawn (non-blocking) - users.notifications_opt_out column (sqlite + postgres migrations 003) - Routes: GET/POST /api/me/notifications/preferences (authed), GET /api/notifications/unsubscribe?token= (HMAC-signed, public HTML page) - HTML+text multipart emails with unsubscribe links Cora 'hardcoded secret' findings verified as false positives: SECRET const in unit tests + format-string interpolation, not credentials.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
7 tasks
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
Email notifications for Rungu (issue #73): notify post authors and commenters by email when a post receives a new comment or changes status.
Why
Feedback boards live or die by the feedback loop — right now users have to poll the board manually. Closing #73 unblocks the core "submit and forget" UX.
Changes
SMTP_DRIVER=log→ render to tracing (dev/CI);SMTP_HOST+SMTP_FROMset → active. Partial config = fail-fastexit(1)so a typo can't silently kill notifications in prod.tokio-rustls+webpki-roots, sharing the rustls stack already used by reqwest. No lettre — keeps the dep tree lean per no-dep policy.comment.createdandpost.status_changednotify post author + all commenters, excluding the actor and opted-out users. Delivery viatokio::spawn: never blocks the request path.sqlite+postgres):users.notifications_opt_outboolean, default opted-in.GET/POST /api/me/notifications/preferences(authed, camelCase),GET /api/notifications/unsubscribe?token=(public, HMAC-SHA256 signed token, minimal HTML confirmation page).Testing
cargo test --workspace: 117 passed, 0 failed (incl. 2 new integration tests: preferences roundtrip + unsubscribe link roundtrip incl. bogus-token rejection, and unit tests for token signing/rendering).cargo clippy --workspace --all-targetsclean;cargo fmt --checkclean.SECRETconst +format!string interpolation, not credentials).Closes #73