Forget a selected airport the new dataset no longer carries - #45
Open
RISCfuture wants to merge 1 commit into
Open
Forget a selected airport the new dataset no longer carries#45RISCfuture wants to merge 1 commit into
RISCfuture wants to merge 1 commit into
Conversation
A leg's airport is remembered in the app group as a record ID, and the FAA retires airports between cycles and occasionally corrects the site number identifying one. Installing a dataset that lacks the record left the selection in place, where the widget and Siri resolved it, failed, and suggested reloading the data that had just removed it — advice that could not work, since no later cycle restores the record either. Installing now forgets a selection the incoming generation cannot resolve, along with the runway chosen on it. The check reads the generation just installed rather than the container the views still hold, which points at the dataset being replaced. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QZ3UWydnavm3g9Gs62Xirb
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.
The problem
A leg's airport is remembered in the app group as a bare record ID (
Defaults[.takeoffAirport]/.landingAirport,Defaults.swift:129-136), and the nav-data store is replaced wholesale each cycle. Nothing reconciled the two.That assumption is now known to be false. FAA site numbers are not stable across cycles: in the 2026-09-03 cycle the FAA corrected FAA LID
18AL(LOUISVILLE STAGEFIELD AHP) from site03329.19to00329.19— a long-standing digit transposition — and it has not been re-published. Airports are also simply retired.When the selected record vanishes,
RunwayPerformanceServicethrowsairportNotFoundand the pilot is told:Neither remedy can work. The identifier was written by the app, not typed; and reloading airport data is precisely what removed the record, so every future cycle fails the same way. The selection lives in the app-group suite — the one extensions can read — so this surfaces in the widget and in Siri, where there is no way to reselect. In-app UI is unaffected; it falls back to "Choose Airport".
The fix
install(generation:)now forgets a selection the incoming dataset cannot resolve, along with the runway chosen on it. Both install paths — the prebuilt download and the property-list import — already converge here, so one call site covers both.The check deliberately does not use the view model's
container. As the comment there notes, that container still reads the generation being replaced until the app reopens its store, so a fetch through it would find the stale airport and clear nothing. It opens the generation just installed instead, with the same in-memory guardmakeImportContaineruses so tests, previews and screenshot runs keep reading the container they were given. A failed fetch reads as "present", so nothing is cleared on the strength of an error.OperationgainsclearSelection(), beside the accessors that already read the selection.Verification
xcodebuild build, schemeSF50 TOLDon iPhone 17 Pro (as CI): BUILD SUCCEEDEDSF50 Shared Unit Testsplan: 419 tests in 50 suites + 15 in 3 suites, all passed--strictwith CI's fetched parent config: 0 violations in 383 files--strictwith CI's config: cleanNotes for review
No tests added.
clearSelection()is wiring, and the prune sits in the app target where nothing currently testsNavDataLoaderViewModel— covering it would mean new scaffolding rather than extending existing coverage. Happy to add one if you'd rather.Based on the stack tip (
navdata/prefer-prebuilt-store) so it lands last without disturbing the ordering of #35–#44. It arguably belongs in #39, whereinstall(generation:)is introduced, but folding it there means rebasing everything above it.🤖 Generated with Claude Code
https://claude.ai/code/session_01QZ3UWydnavm3g9Gs62Xirb