Post save delay before fetching new data to allow for postgres replication

re: #2678 #2667 #1646
I cheated a bit by putting half the delay before showing success pane and half after.
This commit is contained in:
Bryan Housel
2015-06-09 22:38:55 -04:00
parent aaf9267149
commit 9311ee64ab
3 changed files with 12 additions and 9 deletions
+3 -3
View File
@@ -265,9 +265,9 @@ iD.Connection = function() {
}, function(err) {
if (err) return callback(err);
// POST was successful, safe to call the callback.
// Still attempt to close changeset, but ignore response.
// see #2667
callback(null, changeset_id);
// Still attempt to close changeset, but ignore response because #2667
// Add delay to allow for postgres replication #1646 #2678
window.setTimeout(function() { callback(null, changeset_id); }, 2500);
oauth.xhr({
method: 'PUT',
path: '/api/0.6/changeset/' + changeset_id + '/close'
+1 -1
View File
@@ -37,7 +37,7 @@ iD.modes.Browse = function(context) {
});
if (sidebar) {
context.ui().sidebar.hide(sidebar);
context.ui().sidebar.hide();
}
};
+8 -5
View File
@@ -165,9 +165,12 @@ iD.modes.Save = function(context) {
});
showErrors();
} else {
loading.close();
context.flush();
success(e, changeset_id);
// Add delay to allow for postgres replication #1646 #2678
window.setTimeout(function() {
loading.close();
context.flush();
}, 2500);
}
});
} else { // changes were insignificant or reverted by user
@@ -293,8 +296,8 @@ iD.modes.Save = function(context) {
id: changeset_id,
comment: e.comment
})
.on('cancel', function(ui) {
context.ui().sidebar.hide(ui);
.on('cancel', function() {
context.ui().sidebar.hide();
})));
}
@@ -309,7 +312,7 @@ iD.modes.Save = function(context) {
};
mode.exit = function() {
context.ui().sidebar.hide(ui);
context.ui().sidebar.hide();
};
return mode;