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: packages/e2ee-chat/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ Run the frontend at the printed URL once the dev server starts.
51
51
-- You can scope this to specific tables if needed, but the publication name must stay "powersync".
52
52
CREATE PUBLICATION powersync FOR ALL TABLES;
53
53
```
54
-
4. Copy `infra/powersync/sync_rules.yaml` into your PowerSync dashboard so the client can sync the encrypted tables.
54
+
4. Copy `infra/powersync/sync_streams.yaml` into your PowerSync dashboard so the client can sync the encrypted tables using sync streams.
55
55
5. Populate `frontend/.env.local` with the Supabase URL and anon key from the dashboard (see Quickstart above).
56
56
57
57
If you ever need a fresh database during development, run `pnpm --filter @app/chat-e2ee migrate:reset` to drop and reapply the schema locally. To repair discrepancies between your migrations and the remote database, use the Supabase CLI’s `migration repair` command as documented by Supabase.
@@ -91,14 +91,14 @@ If you ever need a fresh database during development, run `pnpm --filter @app/ch
91
91
-**Anonymous sessions** – Enable the Supabase Anonymous provider and the launch screen shows a "Continue as guest" button. Guest users still unlock a local vault, but their messages display the Supabase user UUID unless you add a dedicated `sender_id` column to your schema.
92
92
-**Mirrors** – `startChatMirrors` decrypts encrypted rows per-room, writing plaintext representations into `chat_rooms_plain` and `chat_messages_plain` so the UI can query unencrypted data locally.
93
93
94
-
## Schema & sync rules
94
+
## Schema & sync streams
95
95
96
96
- Supabase schema lives at `packages/e2ee-chat/infra/schema.sql`.
97
-
- PowerSync sync rules live at `packages/e2ee-chat/infra/powersync/sync_rules.yaml` and replicate:
98
-
-The personal vault tables (`chat_e2ee_keys`, `chat_identity_*`).
99
-
-Per-room buckets: encrypted rooms, messages, membership, and the wrapped room keys for the current user.
97
+
- PowerSync sync streams live at `packages/e2ee-chat/infra/powersync/sync_streams.yaml` and configure:
98
+
-Auto-subscribed streams for personal vault tables (`chat_e2ee_keys`, `chat_identity_*`), room metadata, membership records, and wrapped keys.
99
+
-Parameterized streams (`room_members`, `room_messages`) that the client subscribes to on demand when a room becomes active.
100
100
101
-
Run the provided Supabase scripts (see `package.json` scripts) to push the schema to your project. Use the PowerSync dashboard to paste the sync rules.
101
+
Run the provided Supabase scripts (see `package.json` scripts) to push the schema to your project. Use the PowerSync dashboard to paste the sync streams configuration.
102
102
103
103
After editing `infra/schema.sql`, generate and push a fresh migration:
0 commit comments