Commit Graph

21 Commits

Author SHA1 Message Date
Scott Nonnenberg 26884432a2 Update TypeScript, Prettier and typescript-eslint for new TypeScript 3.8 syntax 2020-11-23 14:45:44 -05:00
Evan Hahn 8bfaf598af Add license headers across the project 2020-11-04 13:03:13 -06:00
Chris Svenningsen 8a2c17f65f Apply new ESLint rules to legacy code 2020-09-09 17:34:57 -07:00
Scott Nonnenberg efaa856c35 Don't start rotation mechanisms until queue is empty 2020-07-27 14:39:19 -07:00
Josh Perez 18fd44f504
Move all status/alert dialogs into the Left Pane 2020-02-12 13:30:58 -08:00
Scott Nonnenberg 3938eb9801
A set of fixes and upgrades
* writeToDownloads: Add missing await
* Remove window.isFocused() - not used anywhere!
* Update typescript, p-queue, make necessary changes to fix build
* Slow down sender certificate retries with no existing cert
* Slow down signed prekey refreshes when unlinked - 5s -> 5m
* Update protobufjs to 4.1.2
2020-02-07 14:37:04 -05:00
Scott Nonnenberg 0df9b4b8fb Prevent multiple parallel signed prekey rotations
* Prevent multiple parallel signed prekey rotations

* When logging error, recalculate id to capture sealed sender info
2019-07-03 14:56:49 -04:00
Scott Nonnenberg 5933a34a18 Use window.log in browser context, turn on console eslint rule 2018-07-21 14:52:43 -07:00
Scott Nonnenberg 43a44793c5 Remove jshint - move everything over to eslint
Also removed all hints of previous linters
2018-07-17 15:54:32 -07:00
Daniel Gasienica 95321e5d3e Remove Vim mode lines 2018-04-30 16:53:34 -04:00
Daniel Gasienica 1dd87ad197 Format all source code using Prettier 2018-04-30 16:53:34 -04:00
Daniel Gasienica 32ac99b439 Prefer ISO date formatting
Previously, this was formatted using locale specific settings. This will allow
easier debugging by matching key rotation timestamps against log timestamps.
2018-04-02 18:57:58 -04:00
Scott Nonnenberg c195ba2630
Save prekeys optimistically, track confirms, new clean behavior (#1846)
* Re-enable libtextsecure unit tests, get passing, run in CI

* Save prekeys optimistically, track confirmed, new clean behavior

* Eliminate potential conflicts when rotating on startup

* Remove last symlink: get libtextsecure tests running on windows
2017-12-01 13:35:39 -08:00
Scott Nonnenberg a5923c2177
Key rotation: log failures, retry, force on new version (#1833)
* Retry failed signed key rotation; start rotation when registered (#1772)

* rotateSignedPrekeys: Fix 'res is not defined' error

* If the server rejects key rotation, don't retry immediately

* Force a signed key rotation on launch of any new version
2017-11-30 11:55:59 -08:00
Scott Nonnenberg 9c8fe1a9d8
Reschedule all timers on time travel, set interval back to 1000ms
FREEBIE
2017-09-14 16:53:53 -07:00
Scott Nonnenberg bc437095f6
Calm time travel checks, don't continually reschedule key rotation
FREEBIE
2017-09-14 16:53:53 -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 886557a2aa Drop chrome.runtime.onMessage events
We can use Backbone.Events instead.

// FREEBIE
2017-02-28 11:49:56 -08:00
lilia 536dd7b951 Add signed key rotation scheduler
Rotate signed prekey every 48hrs, waiting for online access if
necessary. After a rotation attempt is made, schedule the next run for
48hrs in the future.

We use a timeout to "wake up" and handle the rotation. This timeout gets
set on startup and whenever the next rotation time is changed. For
paranoia's sake, always clear the current timeout before setting the
next one.

Since new registrations necessarily upload new signed keys, we reset the
scheduled time to T+48hrs on `registration_done` events.

// FREEBIE
2017-02-16 18:06:20 -08:00