Commit graph

2038 commits

Author SHA1 Message Date
Scott Nonnenberg
21325bc922
Move sync messages to silent = true (#1843)
* Set silent = true for all sync messages

* sendmessage.js: Remove brace-less if
2017-12-01 13:31:48 -08:00
Scott Nonnenberg
d9a48478ec
Logging for prekey fetches, load of log files (#1836)
* Log the files discovered in logPath

I've encountered some logs which include very old entries; and my
suspicion is that we're not cleaning up old log files properly.

* Log prekey fetches (success and failure), just like signed keys

* Force log file information into the final web-ready log
2017-11-30 11:56:46 -08:00
Scott Nonnenberg
44da6924f9
A variety of logging improvements to track down bugs (#1832)
* Log when we get a blocked numbers sync message

* Save three old signed keys in addition to the current active

* Remove the mystery from all the error-related log messages

* Log successful load of signed key - to help debug prekey errors

* removeSignedPreKey: Don't hang or crash in error cases

* Log on top-level unhandled promise rejection

* Remove trailing comma in param list, Electron 1.6 does not like

* Harden top-level error handler for strange object shapes
2017-11-30 11:56:29 -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
b8b26d3e79
On group/contact import: don't re-add hidden entries to left pane (#1811)
* On contact import: don't re-add hidden contacts to left pane

* On group import: don't re-add hidden groups to left pane
2017-11-27 15:44:44 -08:00
Scott Nonnenberg
0a4f984cf5
Properly localize group changes (#1802)
* Properly localize group updates

* Remove phone number in display name if contact in address book

* New string for multiple new group members
2017-11-21 16:38:13 -08:00
Scott Nonnenberg
87d8ec723a
Remove conversation from left pane on 'delete messages' (#1807) 2017-11-21 16:37:58 -08:00
Scott Nonnenberg
abb83a895e
Move to e.target.error, transaction/request.error didn't work (#1785)
* Pull error properly from the indexeddb request

* Move to e.target.error, transaction/request.error didn't work
2017-11-21 15:24:04 -08:00
Scott Nonnenberg
1c455c83e0
Set parent window for about/new version, escape to close (#1795)
* Set parent window for about/new version, escape to close

* Exclude jquery from jshint run
2017-11-21 15:23:18 -08:00
Scott Nonnenberg
158b575885
Proper session reset: Delete sessions before and after (#1796)
* web requests: Don't fail if JSON not well-formed in error cases

Turns out that before our move to node-fetch, we ignored JSON.parse()
failures: https://github.com/WhisperSystems/Signal-Desktop/pull/1552/files#diff-1103a6aff0f28b6066715c6994278767L37518

* Update to libsignal v1.2.0, delete sessions on reset session

Previously we only archived sessions when sending or receiving a
'reset secure session, which didn't match up with the mobile apps.
2017-11-21 15:20:07 -08:00
Scott Nonnenberg
83428e5b81
Remove last seen indicator if we get a sync'd outgoing message (#1805)
This mirrors the way Android does things.
2017-11-21 14:41:05 -08:00
Scott Nonnenberg
bd65932d94
Import: Better onerror logging, save attachments serially (#1768)
* Import: Proper error handling and reporting from IndexedDB APIs

* Import: Load attachments one at a time, not per-conversation
2017-11-14 16:40:43 -08:00
Scott Nonnenberg
f0ec75eef4
removeSignedPrekey: Be resilient to delete returning nothing (#1769) 2017-11-14 16:37:44 -08:00
Scott Nonnenberg
f2b5c53d4c
Immediately remove delivery receipts from the retry cache (#1719) 2017-11-07 18:30:54 -08:00
Scott Nonnenberg
cae2b10af6
Increase web request timeout, drop failed delivery receipts (#1699)
Increase web request timeout, drop failed delivery receipts, export error logging
2017-11-07 10:49:10 -08:00
Scott Nonnenberg
845291c51e
Wait for IndexedDB transactions to complete for import scale (#1698)
* No longer reference 'Chrome App' on the start screen

* Imports are only complete when IndexedDB transaction is complete
2017-11-07 10:19:18 -08:00
Scott Nonnenberg
efb5c10d36 Re-enable read receipts and read syncs (#1604) 2017-10-24 10:29:45 -07:00
Scott Nonnenberg
5c8a0d4836 Don't send read syncs or read receipts for messages with errors (#1596) 2017-10-23 16:16:01 -07:00
Scott Nonnenberg
632c8c063c Only start the app up when we've fetched all conversations (#1597)
It's a race condition today, and we don't always win the race.
2017-10-23 16:02:49 -07:00
Lilia
22ccd46f4c Fix setSignedPreKey request - don't expect a JSON response (#1595)
Don't expect a json response from this endpoint. It will only give you
empty responses and exceptions. And sadness.

// FREEBIE
2017-10-23 15:41:27 -07:00
Scott Nonnenberg
6a895f0e27 Better handling of online/offline behavior, socket shutdown (#1593)
* Online/offline: Always stop timer, don't connect if closed

* Sockets: Send our own close event faster, shutdown only on close

Seems that we were too-aggressively disconnecting from all socket
events. Also, we should be able to send our own close event a lot
faster with no ill effects.

* Catch-up libtextsecure changes
2017-10-23 14:38:43 -07:00
lilia
ce0e39aaa7 Fix timeouts
// FREEBIE
2017-10-23 09:26:50 -07:00
Scott Nonnenberg
735aec90e8 Add 5s timeout for all requests but attachment up/down, avatar (#1584)
* Remove hang workaround in api.js since we have global workaround

* Add 5s timeout for all requests exept attachment up/down, avatar
2017-10-20 17:02:44 -07:00
Lilia
af8b0164b5 Move to node fetch API for web requests instead of XHR (#1552)
* Use node-fetch instead of xhr

* Remove XMLHttpRequest.js

// FREEBIE

* Avoid calling json() on non json responses

Previously we would catch and swallow JSON parsing errors resulting from an
empty response, though empty responses are normal from a few endpoints, like
requesting sms or voice registration codes.

Since the JSON parsing call is now handled internally by node-fetch, we have to
keep closer track of our expected response type to avoid throwing an exception.

// FREEBIE
2017-10-20 15:52:02 -07:00
Scott Nonnenberg
dabc56d0cf Load profiles for a conversation without blocking convo load (#1570) 2017-10-18 11:59:12 -07:00
Scott Nonnenberg
f68604c412 models/conversation: Refer to proper error variable (#1569) 2017-10-18 11:58:44 -07:00
Scott Nonnenberg
66d78d3ca6 Log when we've detected a new version (#1567)
Helps with tracking down per-version bugs when log could contain output
from more than one version.
2017-10-18 11:57:34 -07:00
Scott Nonnenberg
1f9fcd64c7 Wait to manually disconnect after receiving 'offline' event (#1561)
* Wait to manually disconnect after receiving 'offline' event

We've received Linux logs indicating that we can get offline/online
blips - only 30ms between the two events. The app was never realy
offline. So this change slows the whole disconnect process down.

* Handle offline startup: register for online event, don't connect
2017-10-13 17:02:08 -07:00
Scott Nonnenberg
75cece3358 Improve OS menu (#1563)
* Remove reload options, new file/help menus, tools/log at bottom

* Further menus refactor: install handlers at template creation

* WIP: Further tune menus, add custom about window

* New About window, new help menu items, menu labels now i18n

* Default device name on registration is now computer hostname

The OS of the device makes sense for those of us testing across a lot of
different OSes. And maybe for a user with just one desktop device. But
most users with multiple desktop devices are using the same OS for both.

* About window: Only show window when content is ready

* Fix typo in app/menu.js
2017-10-13 16:49:16 -07:00
Scott Nonnenberg
61a2a1a8f8 Improve fixtures, restore InboxView rendering on the test page (#1562) 2017-10-13 16:48:50 -07:00
Scott Nonnenberg
151d1797db Fix intermittent conversation sort order problem (#1558)
We were inserting based on what was already in the DOM, instead of
using the index from our conversation collection.

FREEBIE
2017-10-13 11:47:13 -07:00
Scott Nonnenberg
fb7701576e Update autosize, which should fix stack overflow error (#1560)
* Update to the latest version of autosize.js

* gitignore: Restrict 'dist' matches to the root dist folder

The global search for 'dist' caused problems when updateing bower
components.

* A couple minor version updates: ByteBuffer, filesize, intlTel

moment-with-localse, ProtoBuf
2017-10-13 11:44:35 -07:00
Axel
3dc3667b45 Add setting to hide menu bar (#1551)
* Add setting to hide menu bar

Add a setting in the themes section to hide the menu bar.
The menu bar is not needed in everyday use and might not fit in with
signals dark theme. The hidden menu bar can still be shown by pressing
alt.
autoHideMenuBar is added to windowConfig and saved and restored on
startup to prevent flickering.

* Trigger events only when related setting changes

Set the event to trigger on instanciation of the view.
Notification settings no longer reapply the theme or menu bar settings.

* Save window state when closing the window

When not moving or resizing the window, no BrowserWindow config would be
created and saved.
2017-10-13 11:39:18 -07:00
Scott Nonnenberg
f95c65acac Add 100MB file size limit for arbitrary file types (#1555)
Previously we only had limits for audio, video, and image files.

FREEBIE
2017-10-11 14:41:51 -07:00
Scott Nonnenberg
e2d9d855fb Fully eliminate debug from imported data (#1556)
FREEBIE
2017-10-11 14:41:32 -07:00
Scott Nonnenberg
b44f23cc98 Show proper icon when attachment is not an image (#1548)
FREEBIE
2017-10-10 08:49:29 -07:00
Lilia
24f3763836 i18n group updates (#1549)
// FREEBIE
2017-10-10 08:49:12 -07:00
Scott Nonnenberg
b64f2969fd Better handling of network disconnection/reconnection (#1546)
* Ensure that our preload.js setImmediate call finds right function

FREEBIE

* Our own socket close event, better logging, unregistration

FREEBIE

* Return CLOSED for NetworkStatusView if we've fully disconnected

* background.js: Remove messageReceiver = null, log in connect()

A null messageReciever makes the NetworkStatusView think we're online.

FREEBIE
2017-10-06 16:28:13 -07:00
Lilia
52cc8355a6 Feature: Blue check marks for read messages if opted in (#1489)
* Refactor delivery receipt event handler

* Rename the delivery receipt event

For less ambiguity with read receipts.

* Rename synced read event

For less ambiguity with read receipts from other Signal users.

* Add support for incoming receipt messages

Handle ReceiptMessages, which may include encrypted delivery receipts or read
receipts from recipients of our sent messages.

// FREEBIE

* Rename ReadReceipts to ReadSyncs

* Render read messages with blue double checks

* Send read receipts to senders of incoming messages

// FREEBIE

* Move ReadSyncs to their own file

// FREEBIE

* Fixup old comments on read receipts (now read syncs)

And some variable renaming for extra clarity.

// FREEBIE

* Add global setting for read receipts

Don't send read receipt messages unless the setting is enabled.
Don't process read receipts if the setting is disabled.

// FREEBIE

* Sync read receipt setting from mobile

Toggling this setting on your mobile device should sync it to Desktop. When
linking, use the setting in the provisioning message.

// FREEBIE

* Send receipt messages silently

Avoid generating phantom messages on ios

// FREEBIE

* Save recipients on the outgoing message models

For accurate tracking and display of sent/delivered/read state, even if group
membership changes later.

// FREEBIE

* Fix conversation type in profile key update handling

// FREEBIE

* Set recipients on synced sent messages

* Render saved recipients in message detail if available

For older messages, where we did not save the intended set of recipients at the
time of sending, fall back to the current group membership.

// FREEBIE

* Record who has been successfully sent to

// FREEBIE

* Record who a message has been delivered to

* Invert the not-clickable class

* Fix readReceipt setting sync when linking

* Render per recipient sent/delivered/read status

In the message detail view for outgoing messages, render each recipient's
individual sent/delivered/read status with respect to this message, as long as
there are no errors associated with the recipient (ie, safety number changes,
user not registered, etc...) since the error icon is displayed in that case.

*Messages sent before this change may not have per-recipient status lists
and will simply show no status icon.

// FREEBIE

* Add configuration sync request

Send these requests in a one-off fashion when:
  1. We have just setup from a chrome app import
  2. We have just upgraded to read-receipt support

// FREEBIE

* Expose sendRequestConfigurationSyncMessage

// FREEBIE

* Fix handling of incoming delivery receipts - union with array

FREEBIE
2017-10-04 15:28:43 -07:00
Scott Nonnenberg
ffbcb4ecb5 Load debug log dialog immediately, then populate log data (#1540)
An immediate response to the user request to see the log, and then we
show the real data as soon as we've loaded it from disk.

Changes:
  - the IPC exchange to get the log data is now async
  - the API to fetch the log on the client side now returns a Promise
  - in the main process, the only disk access done synchronoously is
    reading the contents of the log directory. The JSON parsing of the
    resultant log data is now split up into three chunks.
  - We only send three keys from each log item to the renderer process:
    msg, time, level. Previously we sent the entire log entry with extra
    keys: hostname, pid, name.

FREEBIE
2017-10-04 14:40:35 -07:00
Scott Nonnenberg
fb674529f4 Override console.log in main process, handle non-strings (#1536)
This should allow us to get an insight into auto-update behavior and
other low-level behaviors happening in the Electron process which would
be useful for debugging.

FREEBIE
2017-10-04 14:03:59 -07:00
Lilia
0b7543b0f6 Fix audio notifications on linux (#1526)
This partially reverts commit 1b444a5e23.
Because support for system-level notification sound settings is inconsistent
across Win/Linux/OSX, do the simplest thing that will produce consistent
behavior on all platforms: suppress the system sound by always passing the
`silent: true` option, and play our own sound clip (copied from ios).

// FREEBIE
2017-10-03 11:08:14 -07:00
Scott Nonnenberg
3c45e9c350 Remove 'debug' from the list of stores we import (#1532)
Now that we log to disk, we no longer need the debug object store from
the Chrome export.

FREEBIE
2017-10-03 11:06:47 -07:00
Lilia
99cf82d01a Remove duplicate definition of getSyncRequest (#1530) 2017-10-02 14:13:54 -07:00
Scott Nonnenberg
f070bc4299 window.onerror: move to proper window.log.error call (#1528)
FREEBIE
2017-10-02 14:13:27 -07:00
Scott Nonnenberg
38152042d5 Ensure final message before 'empty' is ready for notification (#1522)
Without this change, there's a race condition for the notification we
show when we get the 'empty' event after a large backlog download. Four
messages may have come in, but the last might not be notified. So the
count shown would be three. And then, when the final message's notify()
call finishes, another notification would be shown.

FREEBIE
2017-09-29 09:58:37 -07:00
Scott Nonnenberg
10a38297b8 Only show notifications when done with sync (#1507)
This prevents the parade of notifications if a machine wakes up from
sleep. Basically covers situations that the loading screen doesn't
already.

When disabled, notifications will be cached until they are subsequently
re-enabled, at which time all the pending notifications will be summarized.

From the background page, notifications are disabled during connection attempts
until an empty event. This means we can always safely call conversation.notify
to queue a notification for the next batch, dropping some options from message
and conversation model methods.

We've also moved the calls to check window focus and draw attention to the
window, which were previously included in the conversation model, but are now
performed by the Notification system, because the time that the notification is
displayed might be some time after the message is added by the conversation, so
decisions about focus and attention should be made in that moment and not
before.

// FREEBIE
2017-09-29 09:15:28 -07:00
Scott Nonnenberg
3b4fd2d0e0 Eliminate $name$ in two places (#1520)
* Eliminate $name$ when changedRightAfterVerify string is shown

FREEBIE

* Eliminate $name$ when identityKeyErrorOnSend string is shown

FREEBIE
2017-09-29 09:09:40 -07:00
Scott Nonnenberg
95c85010c4 Only retry messages on startup, not every sockect reconnect (#1510)
FREEBIE
2017-09-28 14:58:45 -07:00
Scott Nonnenberg
6323f598b5 Disconnect from socket faster on loss of network access (#1512)
* Disconnect from socket faster on complete loss of network access

Today we wait for a keepalive request to fail; this change forces
disconnect in the case that the browser tells us that we're now offline.

FREEBIE

* MessageReceiver: don't react to errors after explicit close()

FREEBIE
2017-09-28 13:12:43 -07:00