On the mini-program side, when a user is offline, there are two scenarios:
If the other party didn't log out properly but merely switched to the background, causing a disconnection, I send them a message. However, when the other party switches back to the foreground, they cannot receive the offline message I just sent. At this point, there is a record in MongoDB, but there is no record in SQLite.
When a user performs a normal account logout, I send them a message. After the other party successfully logs in, they will receive the offline message.
On the mini-program side, when a user is offline, there are two scenarios:
If the other party didn't log out properly but merely switched to the background, causing a disconnection, I send them a message. However, when the other party switches back to the foreground, they cannot receive the offline message I just sent. At this point, there is a record in MongoDB, but there is no record in SQLite.
When a user performs a normal account logout, I send them a message. After the other party successfully logs in, they will receive the offline message.