@chipmobilesdk/rn-local-db 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -354,7 +354,7 @@ Every one returns a `DeletionOutcome` rather than a bare success — what was re
354
354
 
355
355
  If a deletion is interrupted — a force-quit, a battery death — the next open reports `SCOPE_DELETED` rather than presenting the scope as healthy. Call `deleteScopeData` again to finish it.
356
356
 
357
- A handle whose scope is deleted beneath it reports `SCOPE_DELETED` on its next use. The deletion does not wait for it.
357
+ A handle whose scope is deleted beneath it reports `SCOPE_DELETED` on its next use. The deletion does not wait for it, and nothing revives it: open a new handle and rebuild whatever was built on the old one. An app that retries through the dead handle gets the same error every time, which reaches the user as a screen that only relaunching can fix.
358
358
 
359
359
  ---
360
360
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chipmobilesdk/rn-local-db",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: sdk-rn-local-db
3
- description: "Offline SQLite storage via @chipmobilesdk/rn-local-db: schemas, scoped data, queries, transactions, migrations, attachments, encryption. Use when persisting data locally, writing a migration, or handling sign-out data retention."
3
+ description: "Offline SQLite storage via @chipmobilesdk/rn-local-db: schemas, scoped data, queries, transactions, migrations, attachments, encryption. Use when persisting data locally, writing a migration, deleting a user's data, or handling sign-out data retention."
4
4
  metadata:
5
5
  package: "@chipmobilesdk/rn-local-db"
6
6
  packageVersion: "0.1.0"
@@ -33,12 +33,20 @@ Two concepts cause most of the bugs in this package. Do not skip them:
33
33
  Read `## The scope model` and `## Records and the four value conditions` in the README
34
34
  before designing a schema.
35
35
 
36
- ## Sign-out is not deletion
36
+ ## Deletion, sign-out, and dead handles
37
37
 
38
38
  The README has a dedicated section (`## Deletion, and why sign-out is not deletion`).
39
39
  Treat any "clear data on logout" requirement as a design question answered by that
40
40
  section, not by deleting the database file.
41
41
 
42
+ `deleteScopeData` and `deleteDatabase` are module-level and do not wait for open
43
+ handles. **After either, open a NEW handle and rebuild everything derived from the
44
+ old one** — repositories, providers, the screen behind a retry button. The old handle
45
+ raises `SCOPE_DELETED` (or `CLOSED_HANDLE` if the app closed it first) on every call,
46
+ so a Retry wired to it can never succeed: the app stays broken until the process
47
+ restarts. An interrupted deletion instead reports `SCOPE_DELETED` from the next
48
+ `openDatabase` — call `deleteScopeData` again to finish it, then open.
49
+
42
50
  ## Public API
43
51
 
44
52
  `setDiagnosticLogger`, `Budgets`, and types `DiagnosticLogger`, `DiagnosticCode` are
@@ -53,7 +61,7 @@ surfaces are large — enumerate them from
53
61
  | Need | Section |
54
62
  |---|---|
55
63
  | Install and native setup | `## Install` |
56
- | Data ownership / sign-out | `## The scope model`, `## Deletion, and why sign-out is not deletion` |
64
+ | Data ownership / sign-out / deleting it all | `## The scope model`, `## Deletion, and why sign-out is not deletion` |
57
65
  | Defining tables | `## Declaring a schema` |
58
66
  | Null vs missing vs unset | `## Records and the four value conditions` |
59
67
  | Reading data | `## Queries` |