ws adapter: match main truth (id injection + setDoc merge)

- getDoc/getCollection/subscribe inject {id,...data} (main firebase shape)
- getCollection normalizes backend {id,data}[] OR bare data[] → {id,...data}
- setDoc(opts.merge) → PATCH (create-on-miss); else PUT (replace)
- ws-reconnect test asserts id now present

24/24 server green. All suites green: App 83, shared 91, server 24.
This commit is contained in:
david raistrick
2026-07-04 12:35:28 -04:00
parent 79af61cb8b
commit 6baecd374e
2 changed files with 31 additions and 6 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ describe('BUG-8: ws adapter reconnect after drop', () => {
await flush(1000);
const last = calls[calls.length - 1];
expect(last).toEqual({ name: 'V2' });
expect(last).toEqual({ id: 'a', name: 'V2' });
} finally {
await new Promise(r => storage.dispose(r));
}