Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement client driven sync #7

Open
tantaman opened this issue Nov 9, 2023 · 0 comments
Open

Implement client driven sync #7

tantaman opened this issue Nov 9, 2023 · 0 comments

Comments

@tantaman
Copy link
Owner

tantaman commented Nov 9, 2023

Right now sync follows the same pattern as the original Repliear. We sync the entire issue, description and comment set down (of course chunked) - pictured below.

sync-all.mov

We should swap sync to be controlled by the UI. In other words, as the user navigates to an issue list we sync down all those issues + some set of additional pages.

Implementation Thoughts

pull doesn't take input to a given request but we can use replicache itself to sync the query as mentioned in the docs:

The solution is to sync the current query with Replicache (🤯). That way it will be automatically synced to all tabs.

So we'll do that. The query args currently selected by the user will be synced to the backend through replicache. On pull we'll check and use that query.

Multiple tabs

IMO, we should be able to have many queries syncing at once if the user has many tabs open. One or more queries for each tab.

The query synced to replicache should be tied to a given client id. On pull we'll sync the data for the query attached to that client id.

My assumption here is each tab has a unique client id (docs) and that we have access to this in both pull and push endpoints.

feedback: it seems to me that it'd be easier if rep.pull could just accept parameters . This way we can tell our backend what query we're pulling for each time rather than having to do a song and dance with syncing the query through replicache.

See cvr strategy for how many queries syncing at once interacts with the CVR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant