Triage and notification reliability — transactional writes, XSS fix, retries#235
Merged
Conversation
added 10 commits
April 15, 2026 00:29
… XSS fix, retries, bounded concurrency - Triage persistOutput: wrap cluster/classification inserts in a single DB transaction (store.PersistOutput) so partial writes cannot leave the record inconsistent - Telegram: HTML-escape RunURL in FormatMessage to prevent XSS in href attributes - Telegram: add retry with backoff for 429 (rate limit) and 5xx responses, respect Retry-After header - GitHub status API: add retry for 429 with Retry-After and 5xx server errors - SMTP/general mail: add 3 retries with exponential backoff for transient errors (dial, TLS, 5xx) - Mailer invitation emails: add multipart/alternative HTML body for invitation emails, retry on transient SMTP errors - Webhook dispatch: replace unbounded goroutines with bounded worker pool (default 10) - Triage job: accept parent context for cancellation during graceful shutdown (SetParentContext) - LLM retry: only retry on transient errors (context deadline, killed process), fail fast on client errors (exit code 1) - Invitation emails: add styled HTML alternative part - Invitations migration: make invited_by nullable with ON DELETE SET NULL so user deletion doesn't fail
…apeString, remove orphaned comment
- Extract shared IsTransientSMTPError and defaultSMTPRetries into internal/smtptransient package to eliminate duplication between internal/mail and internal/mailer - Replace hardcoded 'boundary123' MIME boundary with crypto/rand-based unique boundary in mailer to prevent email corruption - Both packages now delegate to smtptransient.IsTransient and smtptransient.DefaultRetries - Add tests for unique boundary uniqueness and multipart content - All tests pass
… its duplicate tests
- Migration 000024: DROP existing invitations_invited_by_fkey before
ADD CONSTRAINT fk_invitations_invited_by, preventing deployment failure
from two FKs on the same column.
- smtptransient: Replace overly broad strings.Contains('55') and ('54')
with regex matching 3-digit SMTP response codes ([45]\d{2}) preceded
by word boundary. Add tests for false positive rejection (timestamps,
port numbers, error IDs).
…reliability and security fixes
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.
Closes droplet sc-pl9c3.
Multiple reliability and security fixes across triage, mail, Telegram, and GitHub integrations:
All 25 packages pass. QA and security reviews completed with no blocking issues.