-
Notifications
You must be signed in to change notification settings - Fork 144
Type, document, and refactor Sync, port tests to Mocha #1331
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
base: master
Are you sure you want to change the base?
Conversation
Use _rs_init instead of custom prototype properties
Only log the message as debug log, without the stack trace refs #839
In order for devs not having to wait feature loading before managing access and caching settings, we need those classes to be instantiated onthe prototype already
FYI, I opened #1334 against this one, because it requires the new cachinglayer test suite. Can re-open against master later, if it doesn't get merged here. |
…s_in_tabs Broadcast change events to other browser tabs
Accidentally left a `.only` in the last commit
Added a rather useful change for conflict events: handling them in apps doesn't require manually using Also, My Favorite Drinks now has support for updating drinks and it will automatically handle conflicts: https://github.com/remotestorage/myfavoritedrinks/blob/master/app.js#L50-L59 |
012e75d
to
91bf93d
Compare
This way, apps can use these the same way as they can use other change events.
91bf93d
to
16fbeb4
Compare
This can cause documents to either not be deleted at all when they should be, but at the least for the parent folder's `local` itemsMap to become inconsistent and potentially persist forever, because it can never be the same as the remote itemsMap again (which is the criterium for removing it).
No changes can be lost when documents are deleted on both ends
11ad749
to
d04f334
Compare
I was able to address almost all of the sub-issues of #1251 in this PR now. The couple of issues that are left open should be addressed in separate PRs after this one is merged. |
It doesn't matter if a client received `sync-started` or not. When there are no more tasks to run after any task has finished successfully, the sync is done. Also removes a superfluous second log statement for when sync is done.
The tests pass on my dev machine, the tests appear to cover new/changed functionality, and there's no code smell. But I'm not familiar enough with the syncing code sign off on this. |
Includes some small other improvements. However, this PR is mostly about properly typing and documenting sync, as well as making the functions more readable by using async/await in many places.
Noteworthy additional changes:
refs #1251 (where I added sub-issues that are all easier to tackle with these changes)
refs #1270
closes #1173
closes #839
fixes #1335
fixes #1204
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.