dagdb icon indicating copy to clipboard operation
dagdb copied to clipboard

Prevent recursion past null prev transaction

Open carsonfarmer opened this issue 3 years ago • 7 comments

This tiny PR prevents the case where one replica is pulling from a remote, and the "search" for ops that have occurred since the replicas were last "in sync" ends up all the way back to its "empty" state. In other words, this catches the situation where replicas have no common point in their histories, beyond their empty state. Note that it might be ok to throw in this case, but it is probably safe to not throw here because we've already passed the common root check. Because of this, we can go all the way back to prev == null, and at that point assume we are just past our empty/initial state, and return the ops we've accumulated up to now.

TODO: Tests

carsonfarmer avatar Oct 25 '20 07:10 carsonfarmer