Pustur/whatsapp-chat-parser

Messages order

mlomb opened this issue · 1 comments

mlomb commented

Sometimes messages are not chronologically ordered, for example WhatsApp may export this (due connection issues I think):

12/21/20, 23:50 - A: blah
12/21/20, 23:49 - B: blah
12/21/20, 23:50 - B: blah

This leads whatsapp-chat-parser to generate the messages array in the same order.

This may be by design, one may want to preserve the exact order messages were found in the text file.
I am working in a project that assumes messages come in chronological order and found out some WhatsApp exports were breaking because of this. I can just sort the messages after the parseString call and everything works fine on my side, I just wanted to let you know that it can happen and you may want to add a warning somewhere or add a sort at the end.


While we are at it, I wanted to thank you for making and maintaining whatsapp-chat-parse, I use it in chat-analytics and WhatsApp is by far the most complicated platform to deal with.

Hey @mlomb,
thanks for opening the issue.

I noticed it too, sometimes due to bad connection the messages get out of order.

I think my library shouldn't make the assumption that the consumer wants the messages sorted, so I think it's better to leave that task to the end user if they want to sort the messages a certain way.
But I agree it should be explained somewhere in the readme. I'll make a note of it.

I already saw your tool through the Network Dependents page once. It looks great! And yes Whatsapp really is the worst. No date standards, multiple languages for system messages, output is different between different iPhone or Android... It's a mess 😅