Let a NOTAM name its runway instead of pointing at it - #36
Merged
RISCfuture merged 1 commit intoSep 9, 2026
Merged
Conversation
RISCfuture
force-pushed
the
navdata/notam-by-identifier
branch
2 times, most recently
from
September 8, 2026 08:00
0d299bf to
5fd595f
Compare
RISCfuture
force-pushed
the
navdata/notam-by-identifier
branch
from
September 8, 2026 15:48
5fd595f to
64758cf
Compare
RISCfuture
force-pushed
the
navdata/notam-by-identifier
branch
2 times, most recently
from
September 8, 2026 18:09
adf7328 to
2ce55a5
Compare
SwiftData cannot express a relationship between models in two store configurations, and it does not say so: it quietly pulls the destination into the configuration instead. Naming the two model sets in the previous commit proved it — nav data and user data came to seventeen entities between them where the app persists ten, because NOTAM.runway dragged Runway in, which dragged Airport, and so on through most of the dataset. So nav data cannot move to a store of its own while that relationship stands. NOTAM now stores the airport record ID and runway designator instead. That pair is already what identifies a runway here: Runway is unique on it, RunwayEntity encodes it for App Intents, and the selected-runway defaults resolve through it. NOTAMStore does the lookup the relationship used to, in one fetch per airport rather than one per row. Resolution is fallible on purpose. Magnetic drift renames a runway, and a renamed runway has to show no NOTAM rather than one written against a designator that has moved; reapOrphans deletes the entries left naming nothing, and says how many went. Both new attributes carry an empty default. SwiftData synthesizes no value for a new mandatory attribute, so without one the store cannot migrate in place and the app cannot open at all — a NOTAM predating this shape arrives holding empty identifiers, names no runway, and is reaped. For the same reason the pair carries no uniqueness constraint: adding one to an entity that already has rows is not a change SwiftData can migrate lightly. NOTAMStore.upsert is the only place a NOTAM is created, and that is what keeps it to one per runway. The view model now owns that creation. It held a NOTAM the editor did not edit otherwise — the badge read zero and the performance numbers ignored the pilot's entry, which the NOTAM UI tests caught. Resolution is fallible on purpose: a renamed runway shows no NOTAM rather than another runway's. Nothing reaps the orphan it leaves, because every import clears the NOTAMs outright — a reap could never find one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01471376Uhug2TYZN8RDFGtq
RISCfuture
force-pushed
the
navdata/notam-by-identifier
branch
from
September 9, 2026 06:38
2ce55a5 to
6462bd0
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.
SwiftData cannot express a relationship between models in two store
configurations, and it does not say so: it quietly pulls the destination
into the configuration instead. Naming the two model sets in the previous
commit proved it — nav data and user data came to seventeen entities
between them where the app persists ten, because NOTAM.runway dragged
Runway in, which dragged Airport, and so on through most of the dataset.
So nav data cannot move to a store of its own while that relationship
stands.
NOTAM now stores the airport record ID and runway designator instead.
That pair is already what identifies a runway here: Runway is unique on
it, RunwayEntity encodes it for App Intents, and the selected-runway
defaults resolve through it. NOTAMStore does the lookup the relationship
used to, in one fetch per airport rather than one per row.
Resolution is fallible on purpose. Magnetic drift renames a runway, and a
renamed runway has to show no NOTAM rather than one written against a
designator that has moved; reapOrphans deletes the entries left naming
nothing, and says how many went.
Both new attributes carry an empty default. SwiftData synthesizes no
value for a new mandatory attribute, so without one the store cannot
migrate in place and the app cannot open at all — a NOTAM predating this
shape arrives holding empty identifiers, names no runway, and is reaped.
For the same reason the pair carries no uniqueness constraint: adding one
to an entity that already has rows is not a change SwiftData can migrate
lightly. NOTAMStore.upsert is the only place a NOTAM is created, and that
is what keeps it to one per runway.
The view model now owns that creation. It held a NOTAM the editor did not
edit otherwise — the badge read zero and the performance numbers ignored
the pilot's entry, which the NOTAM UI tests caught.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01471376Uhug2TYZN8RDFGtq
Stack created with GitHub Stacks CLI • Give Feedback 💬
🤖 Generated with Claude Code
https://claude.ai/code/session_01471376Uhug2TYZN8RDFGtq