be sure to send open group messages in order

pull/1381/head
Audric Ackermann 5 years ago
parent 220de2cd0a
commit efa45f7cbe

@ -1127,7 +1127,7 @@
async sendMessageJob(message) { async sendMessageJob(message) {
try { try {
const uploads = await message.uploadData(); const uploads = await message.uploadData();
const id = message.id; const { id } = message;
const expireTimer = this.get('expireTimer'); const expireTimer = this.get('expireTimer');
const destination = this.id; const destination = this.id;
@ -1236,6 +1236,7 @@
throw new TypeError(`Invalid conversation type: '${this.get('type')}'`); throw new TypeError(`Invalid conversation type: '${this.get('type')}'`);
} catch (e) { } catch (e) {
await message.saveErrors(e); await message.saveErrors(e);
return null;
} }
}, },
async sendMessage( async sendMessage(
@ -1252,7 +1253,6 @@
const expireTimer = this.get('expireTimer'); const expireTimer = this.get('expireTimer');
const recipients = this.getRecipients(); const recipients = this.getRecipients();
this.queueJob(async () => {
const now = Date.now(); const now = Date.now();
window.log.info( window.log.info(
@ -1344,8 +1344,11 @@
await message.saveErrors(errors); await message.saveErrors(errors);
return null; return null;
} }
void this.sendMessageJob(message);
this.queueJob(async () => {
await this.sendMessageJob(message);
}); });
return null;
}, },
async updateAvatarOnPublicChat({ url, profileKey }) { async updateAvatarOnPublicChat({ url, profileKey }) {

@ -1723,7 +1723,7 @@ class LokiPublicChannelAPI {
} }
const pubKey = adnMessage.user.username; const pubKey = adnMessage.user.username;
try {
const messengerData = await this.getMessengerData(adnMessage); const messengerData = await this.getMessengerData(adnMessage);
if (messengerData === false) { if (messengerData === false) {
return false; return false;
@ -1839,6 +1839,10 @@ class LokiPublicChannelAPI {
// now process any user meta data updates // now process any user meta data updates
// - update their conversation with a potentially new avatar // - update their conversation with a potentially new avatar
return messageData; return messageData;
} catch (e) {
window.log.error('pollOnceForMessages: caught error:', e);
return false;
}
}) })
); );

Loading…
Cancel
Save