Storage, migration, hashes and ordering
The SQLite database behind NotesCore, schema migration, content hashes, sort keys and sample data. Decisions: D-09, D-27.
| Behavior | Shared |
|---|---|
| Data survives closing and reopening the database | NotesCoreTest.dataSurvivesRestart |
| A version 1 database migrates and keeps typed titles | OrganizingTest.versionOneDatabasesMigrateAndKeepTypedTitles |
| SHA-256 matches known test vectors | DomainSupportTest.sha256KnownVectors |
| The content hash covers all state that a restore must bring back | DomainSupportTest.contentHashCoversRecoverableState |
| Sort keys always fit between two neighbors and stay short | DomainSupportTest.sortKeysOrder |
| Sample notes seed the same data every time | NotesCoreTest.sampleNotesSeedTheSameDataEveryTime |
| A write against an outdated revision fails as stale | NotesCoreTest.taskToggleCreatesRevisionAndRejectsStaleState, NotesCoreTest.moveDeleteUndelete |
The platform databases (Android SQLite, iOS native driver) are exercised by the integration tests in export-import.md and by every UI test, but always in memory.
Gaps
- Migrations are tested only from version 1. Add a test for each new schema version.
- The on-disk database on a device is never tested; UI tests use an in-memory database. Upgrading an installed app is checked by hand (see
docs/pending.md). - Two writes at once (for example autosave racing a task toggle) are untested.
- iOS backup exclusion (D-11) and Android backup rules (D-10) are untested.