Each socket connection has an in-memory message queue (FIFO) that holds onto recently published messages for the cache duration (12-16 minutes) and is limited to the most recent 100 messages. Consequently, publishing over 100 messages in the window of the subscribe reconnect time inevitably results in older messages overflowing the queue and getting discarded. For the long term, reliable persistence and retrieval of the missed message, you should enable Storage & Playback add-on with a duration up to 30 days or even unlimited and use the history API to retrieve those messages.
For further learning, please see:
- Message Queue section of the knowledge base