earthstar-project / earthstar

Storage for private, distributed, offline-first applications.
https://earthstar-project.org
GNU Lesser General Public License v3.0
639 stars 20 forks source link

Syncing for asynchronous storage in v6+ #71

Closed sgwilym closed 3 years ago

sgwilym commented 3 years ago

What's the problem you want solved?

Porting react-earthstar to use v6.1.0 and the new asynchronous storage has been smooth sailing. There's only one or two things missing before we can consider merging it in.

It seems like there are no ways to directly synchronise an IStorageAsync with a pub over HTTP. In react-earthstar, we seem to be missing equivalents for:

Is there a solution you'd like to recommend?

I know that some of the approaches above are temporary solutions (e.g. the manual sync on tab focus is something I know we want to handle in core, see https://github.com/earthstar-project/react-earthstar/pull/59#issuecomment-777760030).

It's not clear to me whether OnePubOneWorkspaceSyncer is intended to have an async equivalent, as I think some of its responsibilities might be moved into the future EarthstarPeer?

Is it better to wait for these more permanent solutions, or should I try making some async equivalents to the two exports above?

cinnamon-bun commented 3 years ago

I don't know how long EarthstarPeer will take. If you think you can make an async version of either of those existing functions without too much trouble, go for it!

sgwilym commented 3 years ago

73 Added this!