about summary refs log tree commit homepage
path: root/lib/msgthr/container.rb
DateCommit message (Collapse)
2018-04-26fix missing loop check
We failed to detect cyclic dependencies, leading to lost thread roots. In this Ruby version, I also screwed up the `seen' hash check in a misguided effort to avoid an extra hash lookup. The same algorithm was recently fixed in public-inbox: https://public-inbox.org/meta/20180425085249.14974-1-e@80x24.org/ Summarizing what happened with public-inbox: this algorithm can still be thrown off when the References: order presented to us is wrong, so sorting messages by age before feeding to Msgthr#add can improve the results. Regardless of ordering, messages should not become "lost" by the algorithm.
2017-12-28simplify API to avoid (and raise on) user errors
This fixes our API to match the documentation in making Msgthr#order! optional. Furthermore, the block previously passed to Msgthr#order! may now be passed to Msgthr#thread! instead. We accomplish this by tracking internal state explicitly, so a Msgthr::StateError exception will be raised when methods are called in an unsupported order. This internal state is reset with Msgthr#clear. For users who truly do not care about ordering, Msgthr#walk_thread may be called immediately after the last call to Msgthr#add. Thanks to Dimid Duchovny for the feedback which led to this: https://80x24.org/msgthr-public/CANKvuDc2mkxLuh+3+WXWfMXzxK2bShNesrD5xLocGOD1RybbwQ@mail.gmail.com/
2017-06-08improve API documentation and testing
Oh, so that's why I hadn't released this project earlier...
2017-01-01initial