Repository navigation
Fix eligibility hours check skipping NULL has_consolidation_hours - #122
Merged
Merged
Conversation
createRecord() left has_consolidation_hours NULL, and the hours check selected only `= false`, so those rows never had VATSIM hours fetched (408 rows in prod, e.g. CID 1446329). New records now start false, the hours query also matches NULL, and a migration backfills existing rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
Controllers whose
controller_eligibility_cacherow hashas_consolidation_hours = NULLnever get controlling hours fetched, so their profile shows no hours.createRecord()inserts the row with NULL, and the hours check incontroller:eligibilityselects onlyhas_consolidation_hours = false. SQL= 0never matches NULL. The only code that sets the flag tofalseruns when the competency rating changes, so a row whose competency is already at target stays NULL permanently. In prod this affects 408 rows (386 non-initial-selection), e.g. CID 1446329.Fix
createRecord()initializeshas_consolidation_hours = false.NULL. Because of this, existing stuck rows are picked up on the next hourly run even if the migration isn't run.2026_10_02_000000_backfill_null_consolidation_hourssets existing NULLs tofalse. Deploys don't run migrations automatically, so it has to be run by hand (php artisan migrate --path=database/migrations/2026_10_02_000000_backfill_null_consolidation_hours.php) or applied as the equivalentUPDATE.Notes
The next hourly run after deploy will make up to ~408 additional VATSIM API v2
/statscalls (one per previously stuck row). Rows with an empty response keep the existingsleep(60)retry, so the first run may take longer than usual.🤖 Generated with Claude Code