Keep nav data and user data in separate stores - #37
Merged
Conversation
RISCfuture
force-pushed
the
navdata/two-stores
branch
from
September 8, 2026 07:17
208352f to
27f6e07
Compare
RISCfuture
force-pushed
the
navdata/two-stores
branch
from
September 8, 2026 08:00
27f6e07 to
de2f391
Compare
RISCfuture
force-pushed
the
navdata/two-stores
branch
2 times, most recently
from
September 8, 2026 16:19
93adb98 to
0bedc7d
Compare
RISCfuture
force-pushed
the
navdata/two-stores
branch
from
September 8, 2026 16:33
0bedc7d to
9368c2e
Compare
RISCfuture
force-pushed
the
navdata/two-stores
branch
from
September 8, 2026 18:09
9368c2e to
993e788
Compare
Nav data is replaced whole every cycle. Until now it shared a file with the scenarios and NOTAMs the pilot wrote, so replacing it meant deleting rows out from under them — the destructive import this work exists to remove. They are two files now: nav data read-only at NavData, and everything the pilot authored writable at UserData, opened together as one container so a fetch still finds either. Nav data is read-only because a store the app cannot write is a store the app cannot leave half-written. The importer opens its own writable container instead, and the app recovers from a nav store that will not open by discarding it — it is a downloaded file, and a bad download must not cost the pilot the use of the app. The user store keeps trapping, since nothing works without it. Both stores are opened through the same pair of configurations, always. SwiftData records the whole container's schema in every store it opens, so a nav store written by a container of a different shape reads back as one needing migration — and migrating a store opened read-only fails outright, which is how this was found. An install predating the split has its scenarios carried across and the old store retired — in that order, and the old store is what says whether it still has to happen. A carry killed before it saved is therefore run again next launch, rather than stranding the pilot's scenarios in a file nothing opens any more and leaving its tens of megabytes on disk for the life of the install. NOTAMs are not carried: they never outlive a data cycle, and the schema-version bump makes the next launch reload nav data anyway. For the same reason the importer no longer deletes them — a successful load clears them afterwards, through the store they now live in. A UI test's airports are seeded through a writable container before the app opens the store, the same way a downloaded cycle will be. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01471376Uhug2TYZN8RDFGtq
RISCfuture
force-pushed
the
navdata/two-stores
branch
from
September 9, 2026 06:38
993e788 to
17c4beb
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.
Nav data is replaced whole every cycle. Until now it shared a file with
the scenarios and NOTAMs the pilot wrote, so replacing it meant deleting
rows out from under them — the destructive import this work exists to
remove. They are two files now: nav data read-only at NavData, and
everything the pilot authored writable at UserData, opened together as
one container so a fetch still finds either.
Nav data is read-only because a store the app cannot write is a store the
app cannot leave half-written. The importer opens its own writable
container instead, and the app recovers from a nav store that will not
open by discarding it — it is a downloaded file, and a bad download must
not cost the pilot the use of the app. The user store keeps trapping,
since nothing works without it.
Both stores are opened through the same pair of configurations, always.
SwiftData records the whole container's schema in every store it opens,
so a nav store written by a container of a different shape reads back as
one needing migration — and migrating a store opened read-only fails
outright, which is how this was found.
An install predating the split has its scenarios carried across and the
old store retired. NOTAMs are not carried: they never outlive a data
cycle, and the schema-version bump makes the next launch reload nav data
anyway. For the same reason the importer no longer deletes them — a
successful load clears them afterwards, through the store they now live
in.
A UI test's airports are seeded through a writable container before the
app opens the store, the same way a downloaded cycle will be.
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