Fix critical supervisor ordering issue in application.ex - #193
Merged
Conversation
This commit fixes the infinite loop issue where mix phoenix_kit.update
would get stuck checking for Oban configuration and never execute
migrations.
Problems fixed:
1. has_active_oban_config? was checking for hardcoded app name
- BEFORE: Searched for "config :phoenix_kit, Oban"
- AFTER: Searches for ", Oban" to match any app name
- This fix applied to both install.ex and update.ex
2. No automatic restart after adding configuration
- Commands now automatically restart instead of asking user
- Uses is_retry flag and recursive run(argv) call
- Prevents infinite loops with {:missing, true} safety check
3. Removed unused code that caused compilation warnings
- Removed unused 'result' variable in both files
- Removed show_config_added_message/1 function (no longer needed)
Technical implementation:
- Pattern match on {config_status, is_retry} tuple
- First pass {:missing, false}: Add config + automatic restart
- Second pass {:ok, _}: Execute migrations normally
- Safety check {:missing, true}: Prevent infinite loops
Results:
- mix phoenix_kit.update now completes in one command
- Automatically detects missing Oban config (any app name)
- Automatically adds config and reruns
- Executes migrations without manual intervention
- No more "run again" messages - fully automatic
Also includes:
- Comment explaining igniter usage in mix.exs
…ix tasks Changes: - Settings cache checks repo availability before warming - OAuth config loader reduced debug messages from 10 to 3 - Changed OAuth warning to debug level for Mix tasks - Removed verbose cache size logging during retries Impact: - Eliminated error: Failed to warm settings cache - Reduced noise from 20+ to 4 debug messages - Changed warning to debug for expected scenarios - Clean output for mix phoenix_kit.status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses critical startup crash caused by incorrect supervisor ordering during PhoenixKit installation.
Problem
PhoenixKit.Supervisor and Oban were starting before Ecto Repo, causing:
Changes
1. Installation Logic (
application_supervisor.ex)after: [repo]positioning using Igniter API2. Oban Configuration (
oban_config.ex)Application.add_new_childafter: [PhoenixKit.Supervisor]3. Automatic Fix (
phoenix_kit.update)fix_supervisor_ordering/1function4. Documentation
guides/troubleshooting.md)Impact
New Installations:
Existing Installations:
Testing
Migration Path
Users experiencing startup crashes can:
mix phoenix_kit.update(attempts automatic fix)guides/troubleshooting.md