Compression occurs by calling MediaService on the act of sending. But that happens after the message has been created on the database. If somehow compression fails, the message won't be compressed again because MediaService won't be called anymore. Either call MediaService on retry (but we need some flag to detect if the media was compressed yet) or store the message only after successful compression. Or just discard the message but leave it there.
Compression occurs by calling MediaService on the act of sending. But that happens after the message has been created on the database. If somehow compression fails, the message won't be compressed again because MediaService won't be called anymore. Either call MediaService on retry (but we need some flag to detect if the media was compressed yet) or store the message only after successful compression. Or just discard the message but leave it there.