Optimistic locking in mongomapper and eventbus
Published: Apr 27, 2015 In Be My Eyes we use mongomapper and eventbus, both are very good tools that make my everyday life as a developer easier - except when it doesn’t. We had a problem where more than one helper is added to a call. This should not happen. We have a pretty simple if statement in our code. The thing is that many helpers were allowed through the if statement down to the “default” case, where only one should be allowed. I really lost a lot of hair trying to figure out why more than one helper could fall through. It really made no sense, since we assigned a helper and assigned answered to be true. This should mean that the next time a helper tries to answer, she would be told that the call was already answered. But in many cases this did not happen. I searched the codebase through and through for many hours with two things in mind that could be wrong: ...