• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mroderick / codebar-planner / 24180026696
96%
master: 95%

Build:
Build:
LAST BUILD BRANCH: fix/invitation-log-retry-handling
DEFAULT BRANCH: master
Ran 09 Apr 2026 08:29AM UTC
Jobs 1
Files 182
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Apr 2026 08:17AM UTC coverage: 95.523%. First build
24180026696

push

github

mroderick
fix: handle duplicate InvitationLogEntry creation on retry

When re-sending workshop invitations, the InvitationLogger would attempt to
create a new InvitationLogEntry for members with existing invitations,
causing a uniqueness validation error: 'Member has already been taken'.

This fix uses Rails' idiomatic find_or_initialize_by pattern to check if
an entry already exists before creating a new one. If the entry exists
(meaning the member was already processed), it returns the existing entry
without incrementing the counter.

Root cause:
- InvitationLogEntry validates uniqueness on (member_id, invitation_type,
  invitation_id)
- Re-sending invitations to the same workshop would try to log success
  for an already-logged member+invitation combination
- This caused batch jobs to fail mid-process with validation errors

Affected scenarios:
- Re-sending invitations for the same workshop
- Sending invitations with audience='everyone' (processes both students and
  coaches, where a member might be in both groups)
- Retrying failed invitation batches

Fix:
- Replace create! with find_or_initialize_by in log_success, log_failure,
  and log_skipped methods
- Return existing entry if already persisted
- Only increment counter when creating a new entry
- Extract shared helper methods for cleaner code

Tests:
- Add retry tests for all three logging methods to verify no duplicate
  entries are created on repeated calls with the same member+invitation

19 of 19 new or added lines in 1 file covered. (100.0%)

3478 of 3641 relevant lines covered (95.52%)

46.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 24180026696.1 09 Apr 2026 08:29AM UTC 1092
69.88
GitHub Action Run
Source Files on build 24180026696
  • Tree
  • List 182
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24180026696
  • 9adf2598 on github
  • Next Build on fix/invitation-log-retry-handling (#24181382286)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc