Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix peer add(offer) & remove(offer) event order problem
Use LinkedHashSet to maintain NetworkEnvelope ordering when Connection#onBundleOfEnvelopes calls listeners. Connection#onBundleOfEnvelopes builds a set from an ordered list of NetworkEnvelopes, then calls listeners during set iteration. The envelope list ordering is lost if a HashSet is built, but maintained by switching to a LinkedHashSet. Losing the envelope ordering becomes a problem if the peer receives a RemoveDataMessage and an AddDataMessage in the same batch of envelopes, and relays them to listeners in the wrong (random) order. For example, an API 'editoffer' call may result in the edited offer being added, then immediately remove from their UI's offer book.
- Loading branch information