-
Notifications
You must be signed in to change notification settings - Fork 116
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
v1 #48
Comments
@michielboekhoff what do you think? |
@sungwoncho - this is not a bad attempt. One question about this approach: if a backup is made, and if the computer is offline, can new entries still be made in the backup file? If so, we'll have to do some form of synchronization still. We'll have to provide some form of graceful fallback - e.g. if no network connection is detected, to automatically read from the backup file. Otherwise, this sort of online-first functionality risks making life more difficult (and backwards-incompatible) for users without a (stable) network connection. I don't quite see the problem having local changes and then uploading these to the mainline (server). If multiple machines have changes from mainline, the server can insert these into a tree as per their creation time. Mind you, that is with immutable entries. Mutable entries would make it more difficult (e.g. Git merge conflicts). |
Thanks for your idea. I thought about it and agree that making dnote online-first is too much.
Sounds like a good plan. How do you feel about the following for
But the entries might be mutable in the future (editing through web client, api, etc.). My solution is when pulling from the server, we treat the server's data as source of truth and overwrite any conflicts. But I think this requires diffing all the notes while syncing and might be too slow. Any ideas welcome. @YiiKuoChong |
@YiiKuoChong yes, the content of
|
@michielboekhoff @YiiKuoChong thanks for the input. I solved the problem in #51. In short, every time a note or a book is mutated, an action is recorded locally. Sync is much efficient this way because we don't POST the entire note and loop through it on the server. Preview is available on an alpha release. If you have feedback or questions let me know. |
dnote server as the source of truth
Problem: It is impractical to maintain local copy of notes and the server copy at the same time. Doing so, we have to reinvent git. The reason is that dnote needs to resolve conflicts between web and cli. Also users need to pull new data from the server.
Solution: dnote writes to a local copy that gets flushed to the server on every nth command execution.
Shortcomings:
Benefits:
dnote backup
. (solution to shortcoming 1 and 2) -- see belowsolution to shortcoming 2:
Allow users to browse notes and books by using a flag to specify backup file.
Instead of hitting the API, dnote will read from the backup file.
The text was updated successfully, but these errors were encountered: