You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,17 @@ All notable changes to this project are documented in this file.
4
4
5
5
The format follows Keep a Changelog and the project adheres to SemVer.
6
6
7
-
## 0.4.4 - 2026-04-08
7
+
## 0.4.5 - 2026-04-14
8
+
9
+
### Added
10
+
11
+
- Add configurable web Disk backend hooks: `setWebDiskStorageBackend()`, `getWebDiskStorageBackend()`, and `flushWebStorageBackends()`.
12
+
- Extend the web backend contract with optional batch, sizing, subscription, and flush hooks for higher-performance custom backends.
13
+
- Add IndexedDB backend support for `getMany`, `setMany`, `removeMany`, `size`, `flush`, and `BroadcastChannel`-based cross-tab sync.
14
+
- Expand regression coverage for web backend overrides, backend subscription-driven cache invalidation, backend flush hooks, IndexedDB broadcast sync, and IndexedDB error surfacing.
15
+
- Add Disk write buffering APIs: `coalesceDiskWrites`, `storage.setDiskWritesAsync()`, `storage.flushDiskWrites()`, and `storage.getCapabilities()`.
16
+
- Add structured storage error classification via `getStorageErrorCode()` while keeping `isKeychainLockedError()` as the convenience helper, and tag native bridge errors with stable `[nitro-error:<code>]` markers.
17
+
- Extend the example app and smoke runner to cover runtime capabilities, structured error codes, and Disk write buffering flows.
8
18
9
19
### Changed
10
20
@@ -14,6 +24,8 @@ The format follows Keep a Changelog and the project adheres to SemVer.
14
24
- Refresh root tooling to current patch releases for linting, testing, and workspace orchestration.
15
25
- Align the example app to `react-native-nitro-modules 0.35.4`.
16
26
- Add an example-only Expo config plugin that patches the generated iOS `fmt` pod during `pod install`, keeping clean prebuilds working on Xcode 26.4.
27
+
- Switch web operation timing to `performance.now()` when available for tighter metrics on fast paths.
28
+
- Keep the example smoke runner aligned with the expanded web backend API surface, including backend override and flush coverage on web.
Disk writes can now be buffered in JS, similar to secure write coalescing, which is useful when you are doing bursty persistence and want an explicit durability boundary.
By default, web Disk and Secure scopes use `localStorage`. Disk excludes Nitro's secure prefixes, and Secure stores under `__secure_` / `__bio_` prefixes.
339
384
340
-
By default, web Secure scope uses `localStorage` with `__secure_` key prefixing. You can replace it with a custom backend (for example encrypted IndexedDB adapter).
385
+
You can replace either backend with a custom implementation. The minimal backend contract is:
-**Async init**: `createIndexedDBBackend()` opens (or creates) the IndexedDB database and hydrates an in-memory cache from all stored entries before resolving.
378
459
-**Synchronous reads**: all `getItem` calls are served from the in-memory cache — no async overhead after init.
379
-
-**Fire-and-forget writes**: `setItem`, `removeItem`, and `clear` update the cache synchronously, then persist to IndexedDB in the background. The cache is always the authoritative source.
460
+
-**Queued writes + durability**: writes update the cache synchronously, persist in the background, and can be awaited via `await backend.flush()` or `await flushWebStorageBackends()`.
461
+
-**Cross-tab sync**: backend instances on the same `dbName`/`storeName` coordinate through `BroadcastChannel` so cache invalidation reaches other tabs.
380
462
-**Custom database/store**: optionally pass `dbName` and `storeName` to isolate databases per environment or tenant.
@@ -530,16 +623,23 @@ These are synchronous and go directly to the native backend without any serializ
530
623
531
624
---
532
625
533
-
### `isKeychainLockedError(err)`
626
+
### Error Classification
534
627
535
-
Utility to detect iOS Keychain locked errors and Android key invalidation errors in secure storage operations. Returns `true` if the error was caused by a locked keychain (device locked, first unlock not yet performed, etc.) or an Android `KeyPermanentlyInvalidatedException` / `InvalidKeyException`. Always returns `false` on web.
628
+
`getStorageErrorCode(err)` returns a stable classification for common native/web storage failures. Native bridges now emit stable `[nitro-error:<code>]` tags so the classification path does not depend on platform exception wording alone.
629
+
`isKeychainLockedError(err)` remains the convenience helper for retry-after-unlock flows and now delegates to the structured code path.
0 commit comments