Skip to content

Fix test and worker guard after Newsletters extraction - #417

Merged
ddon merged 1 commit into
BeamLabEU:devfrom
timujinne:dev
Mar 16, 2026
Merged

Fix test and worker guard after Newsletters extraction#417
ddon merged 1 commit into
BeamLabEU:devfrom
timujinne:dev

Conversation

@timujinne

Copy link
Copy Markdown
Contributor

Summary

Two fixes for issues discovered in code review of PR #413 (Newsletters extraction).

Changes

Fix 1 — module_test.exs: remove Newsletters from internal modules list

PhoenixKit.Modules.Newsletters was left in @all_internal_modules after being extracted to the phoenix_kit_newsletters package. Code.ensure_loaded! would crash since the module no longer exists in core. Updated describe count 21→20.

Fix 2 — process_scheduled_jobs_worker.ex: symmetric guard for process_scheduled_broadcasts

The guard checked function_exported?(newsletters_mod, :enabled?, 0) but called newsletters_mod.process_scheduled_broadcasts() without a matching check. Added function_exported?(newsletters_mod, :process_scheduled_broadcasts, 0) to prevent Oban worker crash on version mismatch.

Test plan

  • mix compile --warnings-as-errors — clean
  • mix test — 549 tests, 0 failures
  • mix credo --strict — no issues
  • mix dialyzer — passes

- Remove PhoenixKit.Modules.Newsletters from @all_internal_modules in
  module_test.exs (module deleted from core, extracted to separate package)
- Update describe block count from 21 to 20 modules
- Add function_exported? guard for process_scheduled_broadcasts/0 in
  ProcessScheduledJobsWorker to prevent crash on version mismatch
@ddon
ddon merged commit 43c2523 into BeamLabEU:dev Mar 16, 2026
6 checks passed
ddon added a commit that referenced this pull request Mar 16, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@timujinne

Copy link
Copy Markdown
Contributor Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Both fixes correctly address the issues flagged in PR #413 review: test module list cleanup and symmetric function_exported? guard in the scheduled jobs worker.

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.

2 participants