Commit Graph

209 Commits (76a69f7511756acd07ad25416e6deb99ad41e617)

Author SHA1 Message Date
Scott Nonnenberg 9fb079253c Remove errors from the cache when they are shown to the user (#1392)
There's really no reason to retry encryption errors again if they've
already been made user-visible in a conversation.

Also, refactor e->error in background.js onError(), since both e and ev
in this method made it too easy to make a mistake.
8 years ago
Scott Nonnenberg 620b71a649 Maintain original received time when processing queued/error msgs
FREEBIE
8 years ago
Scott Nonnenberg cf5f50cfab Give initIncomingMessage envelope in background.js error handling
FREEBIE
8 years ago
Scott Nonnenberg 7faf83bc01 Read/Delivery Receipts: Wait for resolution in main queue
FREEBIE
8 years ago
Scott Nonnenberg 305bd6b3b8 App loading screen: show messages processed so far
Also, show the same loading screen on index.js before we've bootstrapped
the app.

FREEBIE
8 years ago
Scott Nonnenberg e36aa524c9 background.js: Flow promises properly in error case
FREEBIE
8 years ago
Scott Nonnenberg 39795170c1 Handle the 'extension loaded, reopen window' scenario
Not sure exactly how to think about Chrome app lifetimes, so we're
being conservative. We only show the full-application loading screen
once, on first display of the inbox.

FREEBIE
8 years ago
Scott Nonnenberg 53f2bfbb57 Animated loading screens on startup and first conversation load
FREEBIE
8 years ago
Scott Nonnenberg 3e8b34f3d0 findOrCreateById instead of private-specific method
Anyway, findOrCreateById with no type didn't succeed, because the
conversation didn't validate.

FREEBIE
8 years ago
Scott Nonnenberg f38d715250 Read receipts: Log sender and timestamp when related msg not found
FREEBIE
8 years ago
Scott Nonnenberg 82c0b4aaa6 Add return to onContractReceived for consistency
FREEBIE
8 years ago
Scott Nonnenberg 0adc398a6f Fetch conversation before saving in all sync handlers
FREEBIE
8 years ago
Scott Nonnenberg bd0050b6c6 Cache messages on receipt, remove from cache when processed
FREEBIE
8 years ago
Scott Nonnenberg 9ba5aaa54d Verification sync logging: include whether it was from contact sync
FREEBIE
8 years ago
Scott Nonnenberg f654532fa8 Handle UNVERIFIED sync verification messages (via contact sync)
FREEBIE
8 years ago
Scott Nonnenberg 20451cc827 Show verified/keychange notifications when actually relevant
FREEBIE
8 years ago
lilia fdce4cfc7c Fix failed identity key sync from contact sync
These were failing because ByteBuffers from the protobufs need to be converted
to ArrayBuffers. Fixed by useing the existing handler in MessageReceiver to
process verified messages from contact sync messages and dispatch them as their
own events, reducing some complexity on the application side.

// FREEBIE
8 years ago
lilia 243fd68904 Handle verified state from contact syncs
Treat it just like an isolated verified state sync

// FREEBIE
8 years ago
lilia 1e93b12b90 Update protos with support for null messages
// FREEBIE
8 years ago
Scott Nonnenberg 827addf628 Log on receipt of verified sync after we've processed the state
FREEBIE
8 years ago
Scott Nonnenberg 20f4d48991 Protos: Move to latest iteration of verification protos
FREEBIE
8 years ago
Scott Nonnenberg 4a1dc46ab3 Fixes to get local verification and sync messages working
FREEBIE
8 years ago
Scott Nonnenberg c43d96904d Move to the real verify/trust APIs
This wires up verification sync messages, verification and trust checks
to the trust store instead of using mocked data.

FREEBIE
8 years ago
lilia 52481d1d13 Support for sending and receiving verification sync messages
This adds a new method to message sender for sending verification sync messages
and a new event to message receiver representing incoming verification sync
messages. Currently the event handler just logs the message.

// FREEBIE
8 years ago
Scott Nonnenberg 475d607fd0 Prepare for verification sync messages: receiver, ready to send
FREEBIE
8 years ago
Scott Nonnenberg 3fbd1ab618 Use error.stack instead of error for console log
Chrome/V8 give you the error name, message and callstack at that
property, where toString() gives you [object NavigatorUserMediaError]

FREEBIE
8 years ago
r-clancy 66b19d5cf7 Add support for opening the inbox via a shortcut - fixes #1134. 8 years ago
lilia 16f3717824 Move refresh prekeys out of SignalProtocolStore
Use an event/listener instead

// FREEBIE
8 years ago
lilia aed5735620 Improve keychange notice reliability/perf
Bind a single listener to keychange events from the storage interface,
which then looks up relevant conversations and adds notices to them,
with tests.

Previously we would need to instantiate a conversation model in order to
start listening to its key change events. In practice this usually
happens at startup but we shouldn't rely on it, and it incurs higher
overhead since it creates a different listener for each conversation.

// FREEBIE
8 years ago
lilia 40af226a4a Move Whisper.events out of views and tests 8 years ago
lilia 44a4ff3b52 Refactor install view
Let install view manage the connection to the provisioning socket as
well as cleaning up the window on completion, simplifying options.js.
Call `remove` so that the view stops listening when the window closes.
Move view script and template to background page.
Adds ability to hide nav if this isn't our first run.

// FREEBIE
8 years ago
lilia df65585e71 Network status listens to some global events
Listen for reconnectTimer to display reconnection info. Listen for
unauthorized to update network status immediately after a failed login,
rather than waiting for the normal 5s interval to time out.

// FREEBIE
8 years ago
lilia 3f05c8ff87 Rename window.events to Whisper events
// FREEBIE
8 years ago
lilia fcff07df98 Remove some global refs to window.events
// FREEBIE
8 years ago
lilia 510a5cb7fe Namespace global listeners to Whisper 8 years ago
lilia cce1fe5c4b Simplify openConversation
Now that the InboxView is initialized in the background page context, we
can manipulate it more directly, without going through a global function
on the foreground window.

// FREEBIE
8 years ago
lilia 06e53871b2 Fix blank window after unlink
Don't wait for background init before rendering inbox.

If the client detects that it has become unlinked, it will not call
`init()`, never fire the deferredInit, and never render the inbox,
but we want to allow users access to their local messages even if they
have (perhaps temporarily) unlinked the desktop client.

Also, prefer not to extend Backbone.Model until/unless we really need
it.

// FREEBIE
8 years ago
Sam Vevang ed4991974b set up a new view for displaying the network status
// FREEBIE
8 years ago
Sam Vevang e4a21d1a53 move main application view over to messageReceiver namespace
The goal here is to allow synchronous property lookup between objects
and mvc/backbone semantics.

// FREEBIE
8 years ago
lilia 611bbaef35 Don't hardcode the attachment server url
There may come a day when we may need to change this url from the server
side. On that day, clients should continue to operate normally. The
service should be able to change attachment server locations without
requiring a client update.

// FREEBIE
8 years ago
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
8 years ago
lilia 886557a2aa Drop chrome.runtime.onMessage events
We can use Backbone.Events instead.

// FREEBIE
8 years ago
lilia e4b9c51f88 Rework expiring messages management
// FREEBIE
8 years ago
lilia dfe9ee9679 Remove dead code 8 years ago
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
8 years ago
lilia dfc292ac70 Serialize prekey refreshes & other account mgmt
Fixes #1060

// FREEBIE
8 years ago
lilia 7e06e014c4 Add debug logging for #1030
// FREEBIE
8 years ago
lilia 5be5f985fc Lint 8 years ago
lilia f2bdafc7e9 Validate/reformat phone numbers in contact syncs
Turns out there's no garauntee that Android will send us contact info
with phone numbers in e164 format. When that happens, we fail to update
the correct contact. Fix by performing validation on the incoming number
before attempting to merge changes to the name, avatar, or color.

Fixes #903
8 years ago
lilia 1f0a93bf70 Ensure new installs default to non-blocking
// FREEBIE
9 years ago