25ee61d3cb
We use timers to decide when to query and delete expired messages or when to perform signed key rotations. Internally, timers are counters that get updated when the CPU ticks, so if the CPU sleeps, the timer will stop counting, and start again after it wakes up, ignoring the intervening passage of wall clock time. To fix this, without having to query the database or other potentially high overhead operations too often, use an interval to frequently check the wall clock time. If time jumps forward, trigger a global event so other listeners can update their possibly-inaccurate timers. https://stackoverflow.com/questions/6346849/what-happens-to-settimeout-when-the-computer-goes-to-sleep https://stackoverflow.com/questions/4079115/can-any-desktop-browsers-detect-when-the-computer-resumes-from-sleep // FREEBIE |
||
---|---|---|
.. | ||
models | ||
views | ||
background.js | ||
chromium.js | ||
components.js | ||
conversation_controller.js | ||
conversation_panel.js | ||
database.js | ||
debugLog.js | ||
delivery_receipts.js | ||
emoji_util.js | ||
expire.js | ||
expiring_messages.js | ||
index.js | ||
libphonenumber-util.js | ||
libsignal-protocol-worker.js | ||
libtextsecure.js | ||
Mp3LameEncoder.min.js | ||
notifications.js | ||
options.js | ||
panel_controller.js | ||
read_receipts.js | ||
register.js | ||
registration.js | ||
rotate_signed_prekey_listener.js | ||
signal_protocol_store.js | ||
storage.js | ||
wall_clock_listener.js | ||
WebAudioRecorderMp3.js |