Closed raucao closed 1 month ago
Is there any documentation on how to manually resolve conflicts? I have found the following links that describe some things but I'm still not sure what to do practically speaking:
I am trying to respond to a conflict event by comparing sub-properties of oldValue
and newValue
(for example a date in the object) and then calling storeObject
on the winner, but I seem to be receiving repeated conflict events after saving. Not sure if this is a bug or if I haven't followed the docs. Here's a video: https://www.dropbox.com/s/7cr91y4hkpljap7/2020.07.01%20conflict.mp4?dl=0
I just found the following in #684:
But instead of this now firing a conflict event, the request is repeated indefinitely.
I wonder if it has anything to do with my issue.
@skddc Do you have any guidance on this?
That bug seems to have been fixed a very long time ago:
This bug is fixed in #697 which has already passed first review
If anyone has guidance, it would be @michielbdejong who both opened and fixed that bug...
I was able to stop the conflict event from firing repeatedly by updating the object inside setTimeout
. I'm guessing there's an issue when 'conflict handling' happens synchronously.
The docs explain what a conflict event will look like:
http://remotestorage.io/doc/code/files/baseclient-js.html#RemoteStorage.BaseClient.change
But they don't have an example of how to actually handle a conflict. Apparently in the olden days of the conflict object, there was a
resolve
method on that:https://github.com/nilclass/remotestorage-browser-example/blob/7085df59f2601d72a415c2bc9872134955857200/src/tree.js#L20-L24
So it's also not clear how to update that code.