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

Add ability to fetch only changes for incremental sync to device #68

Open
roeierez opened this issue Jan 4, 2023 · 2 comments
Open

Comments

@roeierez
Copy link
Collaborator

roeierez commented Jan 4, 2023

Ideally the client would pass the last sync timestamp with the outgoing payments query and settled invoices query and the service will reply only with the changes since that timestamp.

@cdecker
Copy link
Collaborator

cdecker commented Jan 6, 2023

We have been looking into pagination (ElementsProject/lightning#4687) and projection (ElementsProject/lightning#5679). I'm not quite sure how well these map to grpc, but it is certainly in the works.

One option we've been looking into is to have a top-level dict entry (along with id jsonrpc, method and params) called meta to pass those constraints in (offset, length limit, ...), and that could be mapped pretty easily to grpc metadata fields, thus allowing to pass them through.

For the shorter term we could provide server-side filtering (you tell us what your last sync-time was and we look for changes and stream them to the app), but I'd wait for the JSON-RPC discussion to settle, before getting started with mapping that to grpc metadata.

Would a change-stream with arbitrary time offset be interesting?

@roeierez
Copy link
Collaborator Author

roeierez commented Jan 6, 2023

All these in-progress items looks promising!
From the mobile perspective projection and flexibility in querying the remote data is not needed because we already use local sqlite that sync all the data from greenlight (we don't really have other choice if if don't want to loos offline support) so we can query locally. Even pagination is not really a requirement.
In fact we only need a way to sync efficiently so the answer is yes, gRPC stream with changes base on timestamp perfectly address this need . It will also reduce client boilerplate code that pull for changes and enable us to stream changes all the way (greenlight => breez sdk => app => UI)

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

2 participants