Repository navigation
Remove a flight that was checked in but not boarded for 24 hours - #350
Merged
Merged
Conversation
OpenTofu plan for
|
oskarbarcz
force-pushed
the
remove-stale-check-ins
branch
from
November 18, 2026 10:53
999b01b to
e3960ea
Compare
A pilot's own import checks them in straight away, and one flight in progress blocks the next import, so an import they never fly would block them for good. Every five minutes, a flight checked in more than 24 hours ago that hasn't started boarding is removed. Each module undoes what check-in started for it: the pilot's current flight and pending travel, the pilot's aircraft entry, the aircraft's checked-in state and pending flight, a rotation that only this check-in started, and the weather watch. Repositionings to the departure airport stay, since that move happened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oskarbarcz
force-pushed
the
remove-stale-check-ins
branch
from
November 18, 2026 11:01
e3960ea to
929892c
Compare
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.
A pilot's own import checks them in straight away, and a flight in progress blocks the next import (#348). An import the pilot never flies would therefore block them for good. This removes a flight that was checked in but hasn't started boarding 24 hours after check-in.
What changes
StaleCheckInRemovalService(automations module, every 5 minutes, throughScheduledJobs.runExclusively):checked_inwhoseflight.pilot-checked-inevent is more than 24 hours old (ListStaleCheckInsQuery)RemoveStaleCheckInCommandon each, logging and carrying on when one failsFlight.removeStaleCheckIn()expectschecked_in(otherwiseStaleCheckInHasMovedOnError, 409) and recordsStaleCheckInWasRemovedEventwith the captain, aircraft and airports. The handler emits it, waits for the listeners, then removes the flight.performing_flighttravel, delete theuser_aircraftrow (it has no cascade, so the delete would fail without it)idle, delete the pendingperforming_flightrepositionin_progress, with no leg flown, goes back toreadyonDelete: SetNull.SCHEDULER_ENABLED="false"), so the seeded January check-ins are safe. In production it also clears check-ins that are already stuck.Tests
checked_in, and every other status is left aloneuser_aircraftrow were gone, and D-AIMC was back toidle.format(whole repo; its only warning is a git-excluded local.impeccablecache CI never sees),lint,test(1449) andtest:functional(1624 scenarios) all exit 0.Version 3.91.0. Stacked on #349.
Knowledge base: mypreflight/product#78.
🤖 Generated with Claude Code