Skip to content

Keep nav data and user data in separate stores - #37

Merged
RISCfuture merged 1 commit into
navdata/notam-by-identifierfrom
navdata/two-stores
Sep 9, 2026
Merged

Keep nav data and user data in separate stores#37
RISCfuture merged 1 commit into
navdata/notam-by-identifierfrom
navdata/two-stores

Conversation

@RISCfuture

@RISCfuture RISCfuture commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

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 CLIGive Feedback 💬

🤖 Generated with Claude Code

https://claude.ai/code/session_01471376Uhug2TYZN8RDFGtq

@RISCfuture
RISCfuture force-pushed the navdata/two-stores branch 2 times, most recently from 93adb98 to 0bedc7d Compare September 8, 2026 16:19
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
RISCfuture merged commit d73f58c into main Sep 9, 2026
5 checks passed
@RISCfuture
RISCfuture deleted the navdata/two-stores branch September 9, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant