Comments (5)
I don't think I added any logic for handling sync conflicts. I almost never have them with the official clients because they save and sync so frequently.
@mobitar, any tips on detecting sync conflicts?
from standardnotes-fs.
Conflicts are returned by the server in an array called unsaved_items
. This is the server letting the client know that the items the client sent to be saved were rejected, because saving them would have resulted in overwriting data. So if the client doesn't handle these unsaved_items, then you'd perpetually have unsycned changes.
from standardnotes-fs.
I don't see an unsaved_items
array, but rather a conflicts
array:
"conflicts": [
{
"server_item": {
"uuid": "4c0bcd94-8c27-11eb-8699-854761ae33c6",
"duplicate_of": null,
"items_key_id": "417b0d02-c431-4f65-ac6f-5927d77e69cf",
"content": "003:06870....5Aw==",
"content_type": "Note",
"enc_item_key": "003:d4260....+Fc9L",
"auth_hash": null,
"created_at": "2021-03-23T22:29:57.238Z",
"updated_at": "2021-03-23T22:32:34.871Z",
"deleted": false
},
"type": "sync_conflict"
}
],
The server seems to keep sending it over and over. What's the correct way to handle a conflict and mark it resolved? Is this documented anywhere? Thanks!
from standardnotes-fs.
conflicts
is part of an older API version. You should be passing 20200115
as the version
param to sync requests.
To handle conflicts you'd need to take the items in the unsaved_items array and create new items out of them (with new UUIDs). That would resolve the conflict essentially.
In SN clients it's a little more intricate since we try not to create conflicts as much as possible, but if you want to take the safest minimal route it would be just to create a new note with a new uuid.
from standardnotes-fs.
Okay @ogourment this should be fixed in a5ae5df. Can you please update, backup, and test conflicts thoroughly in both directions?
Thanks.
from standardnotes-fs.
Related Issues (20)
- Under ubuntu, cd mounted folder shows `Operation not permitted` HOT 10
- Make snfs work after sleep HOT 9
- Debian Stretch HOT 4
- Consider supporting Windows HOT 11
- just get tags folder HOT 2
- Moving in tags not supported HOT 10
- API v20190520 migration HOT 6
- Surprising "UUID does not match " error just started yesterday HOT 15
- Split config and cache HOT 4
- Help: How could I make my notes persistent HOT 3
- Error during initializarion HOT 4
- Unable to create .* files HOT 2
- Some Tag Directories are Unrecognised/Inaccessible HOT 2
- MFA users prompted for code every time HOT 5
- Note is deleted immediately upon save when using customized Emacs HOT 9
- Exporting Notes from Tag Structure HOT 3
- Unable to mount HOT 1
- Unknown Traceback on Mount HOT 18
- Missing pw_cost key error after I updated encryption version to 004 HOT 37
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 standardnotes-fs.