Comments (5)
@michielboekhoff what do you think?
from dnote.
@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).
from dnote.
Thanks for your idea. I thought about it and agree that making dnote online-first is too much.
the server can insert these into a tree as per their creation time
Sounds like a good plan. How do you feel about the following for dnote sync
?
- compress local copy
- POST to server
- server decompresses payload
- compare and get new entries and entries that client is missing
- write new entries to db
- send missing entries to client
- client inserts payload from 6 to local copy
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
from dnote.
@YiiKuoChong yes, the content of .dnote
file is like the following:
{
...
"linux": [
{
"UID": "4ac4h6h5",
"Content": "$0 is the name of the running process",
"AddedOn": 1506231335
}
],
"react": [
{
"UID": "94i3zquv",
"Content": "React Element is an object representation of a DOM node",
"AddedOn": 1499835562
},
{
"UID": "c24bbcd6",
"Content": "React Component is a function or a class which accepts input and returns React Element",
"AddedOn": 1499835860
}
]
}
from dnote.
@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. dnote sync
will push those actions to the server. Server will process those actions, respond with actions that have not been synced with the client yet. And the cli will process those actions to bring the local copy up-to-date with the server copy.
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.
from dnote.
Related Issues (20)
- 404 Not Found /static/main.css HOT 1
- SIGSEGV with latest dnote client and selfhosted server HOT 6
- Improve error handling when SSL is invalid HOT 1
- Editing a note with CLI, removes the public flag when syncing to the server HOT 1
- Documentation website HOT 1
- not support darwin/arm64 HOT 1
- allow password pasting when logging into the sync server in the app HOT 2
- How to install 32bits? HOT 1
- Internal Server Error When Syncing Notes HOT 1
- 403 when using dnote sync HOT 1
- Response 429 "Too many requests" again. HOT 1
- web interface HOT 1
- darwin_arm64 cli binary is broken? HOT 5
- Use OnPremises rather than OnPremise
- GPG encryption HOT 1
- Allow to disable upgrade check HOT 3
- Simplify by removing dependency on Cobra HOT 1
- homebrew install broken HOT 1
- How do I have dnote.exe on Windows connect to a dnote docker host? HOT 1
- Error relocating dnote, need musl(libc) release HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dnote.