You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.
Step 1) In chrome, I update the record of dataset then do synchronize() which gives Success
Step 2) Go to firefox and synchronize() there also Success is called.
Now in firefox I have the latest record that was updated in step (1).
On repeating the above steps multiple time, step(2) stops getting latest record updated in step (1) even when onSuccess is still called for firefox step(2).
Note: To resolve conflict I use deviceLastModifiedDate. Whichever is latest I use that.
`
bnUserPreferencesDataset.synchronize({onSuccess: function () {
contents.fillDatasetMap();
}, onConflict: function (dataset, conflicts, callback) {
var resolved = [];
var i = 0;
while (i < conflicts.length) {
if (conflicts[i].localRecord.deviceLastModifiedDate > conflicts[i].remoteRecord.deviceLastModifiedDate) {
resolved.push(conflicts[i].resolveWithLocalRecord());
} else {
resolved.push(conflicts[i].resolveWithRemoteRecord());
}
i += 1;
}
if (resolved.length) {
dataset.resolve(resolved, function (err) {
if (err) {
return callback(false);
}
return callback(true);
});
}
}, onFailure: function (err) {
console.log(err);
}});`
The text was updated successfully, but these errors were encountered:
I have a record name favoriteView and I believe if I change the value of this record in chrome then on doing synchronize() in firefox I should get conflict because value of favoriteView in Firefox is different. But this does not happen always. Sometimes it works but after 3-4 attempts sync always calls onSuccess and keeps getting old records.
I have to refresh to get the latest records.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Test Case:
Step 1) In chrome, I update the record of dataset then do synchronize() which gives Success
Step 2) Go to firefox and synchronize() there also Success is called.
Now in firefox I have the latest record that was updated in step (1).
On repeating the above steps multiple time, step(2) stops getting latest record updated in step (1) even when onSuccess is still called for firefox step(2).
Note: To resolve conflict I use deviceLastModifiedDate. Whichever is latest I use that.
`
bnUserPreferencesDataset.synchronize({onSuccess: function () {
The text was updated successfully, but these errors were encountered: