Database update sporadically fails

Hi Vlad - sorry, it occurred to me while getting ready to go out that I had not made the problem with the .then version sufficiently clear. It works fine in terms of the database. The problem is to get it to return a promise that only resolves when the update has been done. Ideally, that would be a promise of a return success status true/false depending on if there has been a clash between users or not.