mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
moar send logging
This commit is contained in:
parent
6f527fd2e0
commit
2b2b4232e9
@ -96,6 +96,7 @@ export default class SendQueue {
|
|||||||
async enqueueEvent(eventType, content) {
|
async enqueueEvent(eventType, content) {
|
||||||
const pendingEvent = await this._createAndStoreEvent(eventType, content);
|
const pendingEvent = await this._createAndStoreEvent(eventType, content);
|
||||||
this._pendingEvents.set(pendingEvent);
|
this._pendingEvents.set(pendingEvent);
|
||||||
|
console.log("added to _pendingEvents set", this._pendingEvents.length);
|
||||||
if (!this._isSending && !this._offline) {
|
if (!this._isSending && !this._offline) {
|
||||||
this._sendLoop();
|
this._sendLoop();
|
||||||
}
|
}
|
||||||
@ -127,11 +128,14 @@ export default class SendQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _createAndStoreEvent(eventType, content) {
|
async _createAndStoreEvent(eventType, content) {
|
||||||
|
console.log("_createAndStoreEvent");
|
||||||
const txn = await this._storage.readWriteTxn([this._storage.storeNames.pendingEvents]);
|
const txn = await this._storage.readWriteTxn([this._storage.storeNames.pendingEvents]);
|
||||||
let pendingEvent;
|
let pendingEvent;
|
||||||
try {
|
try {
|
||||||
const pendingEventsStore = txn.pendingEvents;
|
const pendingEventsStore = txn.pendingEvents;
|
||||||
|
console.log("_createAndStoreEvent getting maxQueueIndex");
|
||||||
const maxQueueIndex = await pendingEventsStore.getMaxQueueIndex(this._roomId) || 0;
|
const maxQueueIndex = await pendingEventsStore.getMaxQueueIndex(this._roomId) || 0;
|
||||||
|
console.log("_createAndStoreEvent got maxQueueIndex", maxQueueIndex);
|
||||||
const queueIndex = maxQueueIndex + 1;
|
const queueIndex = maxQueueIndex + 1;
|
||||||
pendingEvent = new PendingEvent({
|
pendingEvent = new PendingEvent({
|
||||||
roomId: this._roomId,
|
roomId: this._roomId,
|
||||||
@ -140,6 +144,7 @@ export default class SendQueue {
|
|||||||
content,
|
content,
|
||||||
txnId: makeTxnId()
|
txnId: makeTxnId()
|
||||||
});
|
});
|
||||||
|
console.log("_createAndStoreEvent: adding to pendingEventsStore");
|
||||||
pendingEventsStore.add(pendingEvent.data);
|
pendingEventsStore.add(pendingEvent.data);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
txn.abort();
|
txn.abort();
|
||||||
|
Loading…
Reference in New Issue
Block a user