zabsalahid / serialport-gsm

SerialPort-GSM is a simplified plugin for communicating with gsm modems. (Primarily for sms) (Focused in PDU mode)
MIT License
88 stars 46 forks source link

enableConcatenation not working as expected #111

Closed AviFix closed 1 year ago

AviFix commented 1 year ago

Hi

I started to use this lib and it seems to be great.

I notest that even when setting the "enableConcatenation" flag to true

if getting existing SMS via getSimInbox, it works fine (long SMS are concatenated into one message)

but if getting SMS via "onNewMessage" listener, then log messages are received as separate messages.

I think the problem is that maybe the messages are received with a bit of a delay and even though the message is 1 of 2 it is still being processed instead of waiting for the last message to arrive before processing all the relevant messages

Any ideas??

Apollon77 commented 1 year ago

Please pass a logger and provide a full log of the communication in such a case including when the events are emitted (maybe also log that)

Apollon77 commented 1 year ago

Final Fix in 4.0.1

Multipart messages, when received, re processed delayed now. The delay is at 10s by default because 5s were too low in some test situations. In fact a user can set the delay to 0 to achieve the behaviour like before (e.g. when someone wants to have the single messages and want to assemble itself)