Commit graph

10 commits

Author SHA1 Message Date
Scott Nonnenberg
832b343031 Expiring messages: Add clarifying comment about destroy() ordering
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
d3fb0e5b46 Expiring messages: destroy only after we've notified conversation
FREEBIE
2017-08-04 12:03:25 -07:00
lilia
267f1f5d93 Use ISO format in log message 2017-04-19 13:58:20 -07:00
lilia
fcff07df98 Remove some global refs to window.events
// FREEBIE
2017-04-12 20:43:16 -07:00
lilia
510a5cb7fe Namespace global listeners to Whisper 2017-04-12 20:43:16 -07:00
lilia
25ee61d3cb Fix timers after suspend/resume/pause
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
2017-03-01 14:36:40 -08:00
lilia
e4b9c51f88 Rework expiring messages management
// FREEBIE
2017-02-22 16:18:01 -08:00
lilia
4230b11f82 Support future compatibility for new timer options
If some future client ever sends us an arbitrary timer value which we do
not currently support, present it as a duration in seconds in timer
update messages and ui, where we would otherwise have rendered nothing,
e.g., "You set the timer to ."

// FREEBIE
2017-02-06 18:22:20 -08:00
lilia
2b2c6ab040 Frontend for timer updates and timer indicator 2016-09-29 16:17:01 -07:00
lilia
96fd017890 Support for incoming expiring messages
When initialized, or when expiration-related attributes change, expiring
messages will set timers to self-destruct. On self-destruct they trigger
'expired' events so that frontend listeners can clean up any collections
and views referencing them.

At startup, load all messages pending expiration so they can start their
timers even if they haven't been loaded in the frontend yet.

Todo: Remove expired conversation snippets from the left pane.
2016-09-28 17:20:02 -07:00