doc1.merge(doc2) fails silently when trying to merge a document with no shared history. I would expect this to either throw an error or give some sort of warning.
Maybe I've missed something in the documentation, but we ended up having to write our own checkSharedHistory function that throws before a merge.