From cb69ab802416fc1ff1eeeb6e6fb90d0e39eb1e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 18 Oct 2015 16:53:47 +0200 Subject: [PATCH] Always keep the oldest timestamp The optimistic lock should be checked with the oldest timestamp to be safer. issue2687 review21491002 --- src/model.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/model.js b/src/model.js index 8e31d3b957..bb8fb6d2b2 100644 --- a/src/model.js +++ b/src/model.js @@ -688,7 +688,10 @@ } value = values[name]; if (name == '_timestamp') { - this._timestamp = value; + // Always keep the older timestamp + if (!this._timestamp) { + this._timestamp = value; + } continue; } if (!(name in this.model.fields)) {