send unsent messages after first sync
This commit is contained in:
parent
707988f806
commit
851100b88a
3 changed files with 11 additions and 0 deletions
|
@ -76,6 +76,7 @@ export default async function main(container) {
|
|||
if (needsInitialSync) {
|
||||
showSession(container, session, sync);
|
||||
}
|
||||
session.notifyNetworkAvailable();
|
||||
} catch(err) {
|
||||
console.error(`${err.message}:\n${err.stack}`);
|
||||
}
|
||||
|
|
|
@ -42,6 +42,10 @@ export default class Room extends EventEmitter {
|
|||
}
|
||||
}
|
||||
|
||||
resumeSending() {
|
||||
this._sendQueue.resumeSending();
|
||||
}
|
||||
|
||||
load(summary, txn) {
|
||||
this._summary.load(summary);
|
||||
return this._syncWriter.load(txn);
|
||||
|
|
|
@ -38,6 +38,12 @@ export default class Session {
|
|||
}));
|
||||
}
|
||||
|
||||
notifyNetworkAvailable() {
|
||||
for (const room of this._rooms) {
|
||||
room.resumeSending();
|
||||
}
|
||||
}
|
||||
|
||||
async _getPendingEventsByRoom(txn) {
|
||||
const pendingEvents = await txn.pendingEvents.getAll();
|
||||
return pendingEvents.reduce((groups, pe) => {
|
||||
|
|
Reference in a new issue