Audit item #12. The fan-out job ran an upfront Plan query plus a per-user tier-name comparison before checking canSendNow('whatsapp'). Both are already covered by canSendNow → canUseChannel + daily-limit count, so the parent was duplicating filtering work that the child DispatchUserNotificationJob would do anyway via channelsFor(). Now the parent does only the cheap pre-check (canSendNow) before dispatching the per-user child job. Iteration uses chunkById(500) to make the memory bound explicit. Each user remains its own queueable unit — independent retry, no shared failure mode across the cohort. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.8 KiB
1.8 KiB