When inserting a DictionaryObject into an ArrayObject, a item gets duplicated

My scenario is as follows.

I have an ArrayObject. [{key, A}, {key, C}, {key, E}}

Im trying to find the correct position to insert {key, B}
So I loop thru the ArrayObjects. Once I find the correct position, I break the loop and call the ArrayObject’s insertDictionary(dict, index) method.

I noticed, when I do that, the result becomes something like [{key, A}, {key, B}, {key, A}, {key, E}}
The item right after the inserted gets updated to be the item before.

I found that, if I dont break my loop and I actually loop thru all the items in the ArrayObject, that will fix the problem.

It seems like without looping the entire collection once, the insert method will cause a duplication/update issue.

This is CouchbaseLite-Swift 2.7.0

Sounds like a bug … could you please post the Swift code to reproduce it?