mirror of
https://github.com/vector-im/element-call.git
synced 2026-09-07 21:45:18 +00:00
Fix periodic rageshake log flush never running
The throttled flush callback returned this.flush instead of calling it (regressed in #2607), so logs were only persisted to IndexedDB on rageshake submission or beforeunload. When the host removes the widget iframe at hangup, the whole call's logs were lost, so a rageshake filed from a later call carries nothing from the affected one.
This commit is contained in:
@@ -204,10 +204,13 @@ class IndexedDBLogStore {
|
||||
// Throttled function to flush logs. We use throttle rather
|
||||
// than debounce as we want logs to be written regularly, otherwise
|
||||
// if there's a constant stream of logging, we'd never write anything.
|
||||
private throttledFlush = throttle(() => this.flush, MAX_FLUSH_INTERVAL_MS, {
|
||||
leading: false,
|
||||
trailing: true,
|
||||
});
|
||||
private throttledFlush = throttle(
|
||||
() => {
|
||||
this.flush().catch((e) => logger.error("Failed to flush logs", e));
|
||||
},
|
||||
MAX_FLUSH_INTERVAL_MS,
|
||||
{ leading: false, trailing: true },
|
||||
);
|
||||
|
||||
/**
|
||||
* Flush logs to disk.
|
||||
|
||||
Reference in New Issue
Block a user