Skip to content

Handle RecordNotFound in SPI UnsubscribeUsersController#8354

Merged
iHiD merged 1 commit into
mainfrom
ihid/handle-missing-user-unsubscribe
Feb 8, 2026
Merged

Handle RecordNotFound in SPI UnsubscribeUsersController#8354
iHiD merged 1 commit into
mainfrom
ihid/handle-missing-user-unsubscribe

Conversation

@iHiD
Copy link
Copy Markdown
Member

@iHiD iHiD commented Feb 8, 2026

Summary

  • Gracefully handle ActiveRecord::RecordNotFound when AWS SES sends a bounce/complaint notification for an email that doesn't belong to any user
  • Changed find_by! to find_by with early return (head :ok) when the user doesn't exist
  • Added test for the missing-user case

Test plan

  • Existing test continues to pass
  • New test verifies 200 response for nonexistent email

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@iHiD iHiD merged commit b59fdc3 into main Feb 8, 2026
8 checks passed
@iHiD iHiD deleted the ihid/handle-missing-user-unsubscribe branch February 8, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant