Skip to content

Commit

Permalink
feat(replicache,zero-client): add support for disabling client group …
Browse files Browse the repository at this point in the history
…forking and use in zero-client (#1887)

zero-cache does not currently work with client-group forking as CVR data is keyed by client group id.  

Eventually zero-cache could support client group forking if it did roughly the following:

- Client Group ABC provides cookie 'DEF @ version'.
- We check that the authenticated userID of ABC matches that of DEF.
- Initialize the new ABC CVR with the rows from DEF.
- Set the new ABC CVR's client set to empty set (rather than the set of client's for DEF)
- Set the new ABC CVR's desired query map to empty (these should all become evictable queries)
- Then proceed with the rest of the initConnectionMessage logic.

See https://rocicorp.slack.com/archives/C013XFG80JC/p1716339090352989 for more context.
  • Loading branch information
grgbkr authored May 22, 2024
1 parent 0b35426 commit 8b2d411
Show file tree
Hide file tree
Showing 6 changed files with 377 additions and 278 deletions.
1 change: 1 addition & 0 deletions packages/replicache/src/persist/clients-test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export async function initClientWithClientID(
mutatorNames,
indexes,
formatVersion,
true,
);
} else {
const [generatedClientID, client, clientMap] = await initClientV4(dagStore);
Expand Down
Loading

0 comments on commit 8b2d411

Please sign in to comment.