Repository navigation
Commit 48ca692
zero-swift: client and storage fixes from the bug sweep (#13)
* test(zero-swift): sweep tests for swift-client-fixes
Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859
Co-authored-by: tmm <tmm@tmm.dev>
* fix(zero-swift): a poke that changes nothing marks got queries authoritative
As in zero.ts, the poke callback marks the got queries authoritative after rep.poke, even when the poke is a no-op, if the socket it came on is still the current one. An empty first poke after a reconnect or relaunch left views and preloads incomplete.
Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859
Co-authored-by: tmm <tmm@tmm.dev>
* fix(zero-swift): <= and >= filters never match NaN
JS compareValues returns a - b, which is NaN for a NaN operand, so <= and >= are false. compare keeps its total order for sorting.
Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859
Co-authored-by: tmm <tmm@tmm.dev>
* fix(zero-swift): storage failures reach every client and busy writes are retried
- Every client sharing a ReplicaDatabase hears about a write failure; a closed client is removed.
- SQLiteStore stops writing at the first failure, so writes queued before it don't land after it.
- SQLITE_BUSY/LOCKED is not a storage failure (classifySQLiteError): the ops are kept and written with the next write.
- A read failure loading the client group in initClient is reported and moves the client to memory, as for a failed open.
- The memory fallback after a failed open is shared by name, like .memory (fallbackStoreProvider, MemStore).
- Drop the two SweepStorageTests for active clients, fixed on another branch.
Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859
Co-authored-by: tmm <tmm@tmm.dev>
* test(zero-swift): await a task instead of a semaphore in the busy test
macOS rejects DispatchSemaphore.wait() in an async context.
Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859
Co-authored-by: tmm <tmm@tmm.dev>
---------
Co-authored-by: Amp <amp@ampcode.com>1 parent a548803 commit 48ca692
9 files changed
Lines changed: 1742 additions & 27 deletions
File tree
- .changeset
- packages/zero-conformance/src/ivm
- swift
- Sources/Zero
- Client
- Query
- Storage
- Tests
- ConformanceTests
- ZeroTests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments