trivago / gollum

An n:m message multiplexer written in Go
http://gollum.readthedocs.org/en/latest/
Apache License 2.0
940 stars 74 forks source link

Fix empty metadata after message cloning #247

Closed msiebeneicher closed 5 years ago

msiebeneicher commented 5 years ago

The purpose of this pull request

Checklist

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.06%) to 71.652% when pulling f6bc639f2b4297f8df54f7c4602f14267e1b6883 on bugfix/fix_empty_meta_data_after_cloning into 892ba2d40851b7d507fab33c212fbbef5207386f on master.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.06%) to 71.652% when pulling f6bc639f2b4297f8df54f7c4602f14267e1b6883 on bugfix/fix_empty_meta_data_after_cloning into 892ba2d40851b7d507fab33c212fbbef5207386f on master.

arnecls commented 5 years ago

Found and fixed an issue after merging. The thing with CloneOriginal is that we create a copy of the current state first and then either need to clone the current metadata (to avoid changes "leaking" into the copy) or explicitly set it to nil as the original (as defined by the "freeze" operation) does not have metadata.

See commit: https://github.com/trivago/gollum/commit/7c14a24d471b75c5b1642f2a3a961b7028380c3c