Fixes thread.id being None when logging
Correctly ignores duplicate message ids