mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
**Problem:** Deployment failure notifications were not being sent due to two bugs: 1. **Timing Issue in next() function:** - When failed() called next(FAILED), the database still had status "in_progress" - The notification check looked for ALREADY failed status (not found yet) - Status was updated AFTER the check, losing the notification 2. **Direct Status Update:** - Healthcheck failures directly updated status to FAILED - Bypassed next() entirely, no notification sent **Solution:** Refactored status transition logic with clear separation of concerns: - Moved notification logic AFTER status update (not before) - Created transitionToStatus() as single source of truth - Added completeDeployment() and failDeployment() for clarity - Extracted status-specific side effects into dedicated methods - Updated healthcheck failure to use failDeployment() **Benefits:** - ✅ Notifications sent for ALL failure scenarios - ✅ Clear, self-documenting method names - ✅ Single responsibility per method - ✅ Type-safe using enum instead of strings - ✅ Harder to bypass notification logic accidentally - ✅ Backward compatible (old next() preserved) **Changed:** - app/Jobs/ApplicationDeploymentJob.php (+101/-21 lines) Fixes #6911 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| ApplicationDeploymentJob.php | ||
| ApplicationPullRequestUpdateJob.php | ||
| CheckAndStartSentinelJob.php | ||
| CheckForUpdatesJob.php | ||
| CheckHelperImageJob.php | ||
| CleanupHelperContainersJob.php | ||
| CleanupInstanceStuffsJob.php | ||
| CleanupStaleMultiplexedConnections.php | ||
| CoolifyTask.php | ||
| DatabaseBackupJob.php | ||
| DeleteResourceJob.php | ||
| DockerCleanupJob.php | ||
| GithubAppPermissionJob.php | ||
| PullChangelog.php | ||
| PullHelperImageJob.php | ||
| PullTemplatesFromCDN.php | ||
| PushServerUpdateJob.php | ||
| RegenerateSslCertJob.php | ||
| RestartProxyJob.php | ||
| ScheduledJobManager.php | ||
| ScheduledTaskJob.php | ||
| SendMessageToDiscordJob.php | ||
| SendMessageToPushoverJob.php | ||
| SendMessageToSlackJob.php | ||
| SendMessageToTelegramJob.php | ||
| SendWebhookJob.php | ||
| ServerCheckJob.php | ||
| ServerCleanupMux.php | ||
| ServerConnectionCheckJob.php | ||
| ServerFilesFromServerJob.php | ||
| ServerLimitCheckJob.php | ||
| ServerManagerJob.php | ||
| ServerPatchCheckJob.php | ||
| ServerStorageCheckJob.php | ||
| ServerStorageSaveJob.php | ||
| StripeProcessJob.php | ||
| SubscriptionInvoiceFailedJob.php | ||
| UpdateCoolifyJob.php | ||
| UpdateStripeCustomerEmailJob.php | ||
| ValidateAndInstallServerJob.php | ||
| VerifyStripeSubscriptionStatusJob.php | ||
| VolumeCloneJob.php | ||