I just opened this PR for typing, documenting, and refactoring the Sync class (and a bit of CachingLayer):
remotestorage:master ← remotestorage:feature/1251-sync
opened 02:05PM - 08 Jun 25 UTC
Includes some small other improvements. However, this PR is mostly about properl… y typing and documenting sync, as well as making the functions more readable by using async/await in many places.
Also adds a new event called "sync-started", when a periodic/background sync has started (but not when outgoing changes are synced immediately).
refs #1251 (where I added sub-issues that are all easier to tackle with these changes)
closes #1173
P.S.: I rebased the branch as much as possible before opening the PR. But there are too many conflicts when trying to consolidate the rest even more.
It took me a few days to get through this, but it’s looking so much better now!
Most of the types that were still missing are part of this pull request, and the Sync tests have been ported entirely.
I know it’s a lot to ask from a reviewer, but any and all help with getting this merged would be very much appreciated!
1 Like
raucao
June 9, 2025, 11:53am
2
This widget PR uses the new “sync-started” event:
remotestorage:master ← remotestorage:feature/sync-started
opened 11:43AM - 09 Jun 25 UTC
It's faster than waiting for the first sync request to have finished (or failed)… .
(The feature is currently only available in https://github.com/remotestorage/remotestorage.js/pull/1331)
And this one makes it feel snappier simply by removing words from the UI:
remotestorage:master ← remotestorage:ui/last-synced
opened 11:49AM - 09 Jun 25 UTC
It was bugging me for a long time that the widget would always say "synced just … now" and then show "synced 20, 30, 120... seconds ago" later.
I changed it to just "synced" and "offline", and it immediately felt much, *much* better than before.
WDYT?
raucao
June 18, 2025, 10:56am
3
FYI, the PR now addresses nearly all of the open issues regarding caching and sync (that aren’t about Dropbox or Google Drive). It could really use some more eyes on it now…
During development, I have also considerably improved our main example app My Favorite Drinks (source code ), which now allows editing/updating of items, and also demonstrates how to handle conflicts in app code (among other things like e.g. mobile support).
The deployed version uses my PR branch for now, so it can use some of the fixes and improvements already.