chore: document formatting rules
This commit is contained in:
@@ -53,11 +53,11 @@ App (Vue/TS) → Orchestrator (policy) → Native Adapters:
|
||||
|
||||
### SQLite Ownership & Concurrency *(Planned)*
|
||||
|
||||
* **One DB file:** The plugin will open the **same path** the app uses (no second DB).
|
||||
* **Migrations owned by app:** The app executes schema migrations and bumps `PRAGMA user_version` (see Glossary → PRAGMA user_version). The plugin **never** migrates; it **asserts** the expected version.
|
||||
* **WAL mode:** Open DB with `journal_mode=WAL`, `synchronous=NORMAL`, `busy_timeout=5000`, `foreign_keys=ON`. WAL (see Glossary → WAL) allows foreground reads while a background job commits quickly.
|
||||
* **Single-writer discipline:** Background jobs write in **short transactions** (UPSERT per slot), then return.
|
||||
* **Encryption (optional):** If using SQLCipher, the **same key** is used by both app and plugin. Do not mix encrypted and unencrypted openings.
|
||||
- **One DB file:** The plugin will open the **same path** the app uses (no second DB).
|
||||
- **Migrations owned by app:** The app executes schema migrations and bumps `PRAGMA user_version` (see Glossary → PRAGMA user_version). The plugin **never** migrates; it **asserts** the expected version.
|
||||
- **WAL mode:** Open DB with `journal_mode=WAL`, `synchronous=NORMAL`, `busy_timeout=5000`, `foreign_keys=ON`. WAL (see Glossary → WAL) allows foreground reads while a background job commits quickly.
|
||||
- **Single-writer discipline:** Background jobs write in **short transactions** (UPSERT per slot), then return.
|
||||
- **Encryption (optional):** If using SQLCipher, the **same key** is used by both app and plugin. Do not mix encrypted and unencrypted openings.
|
||||
|
||||
*Note: Currently using SharedPreferences (Android) / UserDefaults (iOS) with in-memory cache. See Implementation Roadmap → Phase 1.1 for migration steps.*
|
||||
|
||||
@@ -90,18 +90,18 @@ App (Vue/TS) → Orchestrator (policy) → Native Adapters:
|
||||
|
||||
### DB Path & Adapter Configuration *(Planned)*
|
||||
|
||||
* **Configure option:** `dbPath: string` (absolute path or platform alias) will be passed from JS to the plugin during `configure()`.
|
||||
* **Shared tables:**
|
||||
- **Configure option:** `dbPath: string` (absolute path or platform alias) will be passed from JS to the plugin during `configure()`.
|
||||
- **Shared tables:**
|
||||
|
||||
* `notif_contents(slot_id, payload_json, fetched_at, etag, …)`
|
||||
* `notif_deliveries(slot_id, fire_at, delivered_at, status, error_code, …)`
|
||||
* `notif_config(k, v)`
|
||||
* **Open settings:**
|
||||
- `notif_contents(slot_id, payload_json, fetched_at, etag, …)`
|
||||
- `notif_deliveries(slot_id, fire_at, delivered_at, status, error_code, …)`
|
||||
- `notif_config(k, v)`
|
||||
- **Open settings:**
|
||||
|
||||
* `journal_mode=WAL`
|
||||
* `synchronous=NORMAL`
|
||||
* `busy_timeout=5000`
|
||||
* `foreign_keys=ON`
|
||||
- `journal_mode=WAL`
|
||||
- `synchronous=NORMAL`
|
||||
- `busy_timeout=5000`
|
||||
- `foreign_keys=ON`
|
||||
|
||||
*Note: Currently using SharedPreferences/UserDefaults (see Glossary → Tiered Storage). Database configuration is planned for Phase 1.*
|
||||
|
||||
@@ -230,9 +230,9 @@ require(uv >= MIN_EXPECTED_VERSION) { "Schema version too old" }
|
||||
|
||||
### DB Sharing *(Planned)*
|
||||
|
||||
* **Shared DB visibility:** A background prefetch writes `notif_contents`; the foreground UI **immediately** reads the same row.
|
||||
* **WAL overlap:** With the app reading while the plugin commits, no user-visible blocking occurs.
|
||||
* **Version safety:** If `user_version` is behind, the plugin emits an error and does not write (protects against partial installs).
|
||||
- **Shared DB visibility:** A background prefetch writes `notif_contents`; the foreground UI **immediately** reads the same row.
|
||||
- **WAL overlap:** With the app reading while the plugin commits, no user-visible blocking occurs.
|
||||
- **Version safety:** If `user_version` is behind, the plugin emits an error and does not write (protects against partial installs).
|
||||
|
||||
*Note: Currently using SharedPreferences/UserDefaults with in-memory cache. SQLite sharing is planned for Phase 1.*
|
||||
|
||||
@@ -244,4 +244,4 @@ Web-push functionality has been retired due to unreliability. All web-push relat
|
||||
|
||||
---
|
||||
|
||||
_This document consolidates the Native-First notification system strategy, implementation details, capabilities, and acceptance criteria into a single comprehensive reference._
|
||||
*This document consolidates the Native-First notification system strategy, implementation details, capabilities, and acceptance criteria into a single comprehensive reference.*
|
||||
|
||||
Reference in New Issue
Block a user