Commit graph

277 commits

Author SHA1 Message Date
Scott Nonnenberg
64fe9dbfb2
Clean logs on start - and eslint/mocha with code coverage (#1945)
* Clean logs on startup; install server-side testing/linting

* Add eslint config, make all of app/ conform to its demands

* Add Node.js testing and linting to CI

* Lock project to Node.js 7.9.0, used by Electron 1.7.10

* New eslint error: trailing commas in function argumensts

Node 7.9.0 doesn't like trailing commas, but Electron does

* Move electron to devDependency, tell eslint it's built-in
2018-01-08 13:19:25 -08:00
Scott Nonnenberg
66aa76e501
Log out information from DOMException when import fails (#1923)
This should give us the information we're looking for when imports fail
mysteriously!

https://developer.mozilla.org/en-US/docs/Web/API/DOMException
2018-01-04 16:26:41 -08:00
Scott Nonnenberg
f0aaa7a1c5
Introduce intl-friendly sort order for contact lists (#1900) 2017-12-14 16:30:11 -08:00
Lilia
9c7ba87d6a Add support for Emoji 5 (#1797)
* Add support for Emoji 5

Update to latest emoji-datasource and emoji-js and switch to an up-to-date fork
of emoji-panel.

// FREEBIE

* Dark theme support for emoji-panel

Fixes #1763

// FREEBIE
2017-11-27 15:54:59 -08: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
9db0cb49c4 setTimeout/setImmediate workaround for linux hangs (#1497)
FREEBIE
2017-09-22 11:06:52 -07:00
Lilia
4449a5f110 Upgrade emoji support (#1482)
* Upgrade emoji deps and move to node_modules

Add support for Emoji 3.0 and switch from bower to yarn for managing emoji
dependencies.

// FREEBIE

* Delete old emoji deps

// FREEBIE

* Don't copy emoji on windows

It is no longer necessary since the symlinked image dir is gone.

// FREEBIE

* Update emoji test

// FREEBIE

* Fix emoji tests; remove all overrides of emoji-js functions

FREEBIE
2017-09-15 13:22:11 -07:00
Scott Nonnenberg
7f8ade7747
Remove migration-related functionality, leaving export stuff
FREEBIE
2017-09-14 17:03:14 -07:00
Scott Nonnenberg
0fbe43c2dc
Protobufs: More logging on failure to load protobufs, fix tests
FREEBIE
2017-09-14 17:02:45 -07:00
Scott Nonnenberg
63e41612b7
Remove spellchecking on the debug log field - causes big slowdown
FREEBIE
2017-09-14 16:53:52 -07:00
lilia
33a82cc8e8
Add spellcheck smoke test
Exposes the spellcheck provider as window.spellChecker, which allows it to be
called from tests.
2017-09-14 16:53:48 -07:00
Scott Nonnenberg
63dcd43025
Add manual test scenarios for remembering window state
FREEBIE
2017-09-14 16:53:48 -07:00
Scott Nonnenberg
3a3aa3efb6
Remove test/protos symlink, use window.PROTO_ROOT for config 2017-09-14 16:53:48 -07:00
Scott Nonnenberg
f84d8038c1
Remove i18n stub used in NetworkStatusView tests
FREEBIE
2017-09-14 16:53:47 -07:00
Scott Nonnenberg
cb296fcfaa
Cleanup: Add unit-tests task to grunt test, fix style checks
And improve success logging in unit-tests.

FREEBIE
2017-09-14 16:53:47 -07:00
Scott Nonnenberg
b9b9abf76a
Fix emoji tests - image paths are no longer absolute
FREEBIE
2017-09-14 16:53:47 -07:00
Scott Nonnenberg
4402a91976
Use correct locale, fall back to en if we don't have translations
FREEBIE
2017-09-14 16:53:47 -07:00
Scott Nonnenberg
18b8907c96
Fix non-rendering unicode characters on test page
FREEBIE
2017-09-14 16:53:46 -07:00
Scott Nonnenberg
a9b4109e9b
Fix NetworkStatusView tests' stubbing of window.i18n
FREEBIE
2017-09-14 16:53:46 -07:00
Scott Nonnenberg
c77554533c
Fix emoji test, since emoji image paths no longer start with /
FREEBIE
2017-09-14 16:53:46 -07:00
Scott Nonnenberg
cc6dcf67b7 Export: Limit attachment filename length, + convo date, + tests (#1439)
* Export: limit attachment names to 30 chars, tests for helper fns

Also, reintroduce last contact date in conversation dir name

FREEBIE

* MessageView tests: Fix failures during blanket coverage run

FREEBIE
2017-09-06 18:20:42 -07:00
Scott Nonnenberg
4cba16cb61 Fetch all conversations on startup of app, not on inbox load (#1437)
* Fetch all conversations on startup of app, not on inbox load

A recent change to fetch conversations less didn't take into account all
that can happen in the app without the inbox loaded. That only happens
when the window is shown, and messages can come in with the app in the
background. In that case, the conversation wouldn't have been loaded
from the database, but would be saved to the database anyway, losing
data.

This change fetches all conversations as soon as the the data store is
ready for a fetch. It also introduces failsafe throws to ensure that
synchronous ConversationController accesses don't happen until the
initial fetch is complete. A new getUnsafe() method was required to
account for some of the model setup that happens during that initial
conversation fetch.

Fixes #1428

FREEBIE

* Fix tests: ConversationController.load() required before get()

FREEBIE
2017-09-06 18:18:46 -07:00
Scott Nonnenberg
d8ce198f55 Fetch conversations once, clean up ConversationController API (#1420)
* Fetch conversations once, clean up ConversationController API

Race conditions around re-fetching have caused some problems recently,
so this removes the need to re-fetch conversations. They are fetched
once or saved once, and that is it. All interaction goes through the
ConversationController, which is the central source of truth.

We have two rules for Conversations:

1. If a conversation is in the ConversationController it doesn't need
   to be fetched, but its initial fetch/save might be in progress. You
   can wait for that fetch/save with conversation.initialPromise.
2. If a conversation is not already in the ConversationController, it's
   not yet in the database. It needs to be added to the
   ConversationController and saved to the database.

FREEBIE

* Remove Conversation.fetch() call in Message.handleDataMessage()

FREEBIE

* ConversationController.API cleanup: Fix two missing spots

FREEBIE
2017-09-01 09:10:41 -07:00
Scott Nonnenberg
c0cd733139 Full export, migration banner, and full migration workflow - behind flag (#1342)
* Add support for backup and restore

This first pass works for all stores except messages, pending some scaling
improvements.

// FREEBIE

* Import of messages and attachments

Properly sanitize filenames. Logging information that will help with
debugging but won't threaten privacy (no contact or group names),
where the on-disk directories have this information to make things
human-readable

FREEBIE

* First fully operational single-action export and import!

FREEBIE

* Add migration export flow

A banner alert leads to a blocking ui for the migration. We close the socket and
wait for incoming messages to drain before starting the export.

FREEBIE

* A number of updates for the export flow

1. We don't immediately pop the directory selection dialog box, instead
  showing an explicit 'choose directory' button after explaining what is
  about to happen
2. We show a 'submit debug log' button on most steps of the process
3. We handle export errors and encourage the user to double-check their
  filesystem then submit their log
4. We are resilient to restarts during the process
5. We handle the user cancelling out of the directory selection dialog
  differently from other errors.
6. The export process is now serialized: non-messages, then messages.
7. After successful export, show where the data is on disk

FREEBUE

* Put migration behind a flag

FREEBIE

* Shut down websocket before proceeding with export

FREEBIE

* Add MigrationView to test/index.html to fix test

FREEBIE

* Remove 'Submit Debug Log' button when the export process is complete

FREEBIE

* Create a 'Signal Export' directory below user-chosen dir

This cleans things up a bit so we don't litter the user's target
directory with lots of stuff.

FREEBIE

* Clarify MessageReceiver.drain() method comments

FREEBIE

* A couple updates for clarity - event names, else handling

Also the removal of wait(), which wasn't used anywhere.

FREEBIE

* A number of wording updates for the export flow

FREEBIE

* Export complete: put dir on its own line, make text selectable

FREEBIE
2017-08-28 13:06:10 -07:00
Scott Nonnenberg
53f2bfbb57 Animated loading screens on startup and first conversation load
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
ef3431af1b isUntrusted: Return false if firstUse is true
Because users will see this upon first trying to communicate with a new
contact if they're quick about it.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
cc2c3edaa6 Override Backbone's trigger with one that catches exceptions
Model operations are vulnerable to exceptions thrown by event handlers.
Because this can interrupt really important data operations, it's better
to let the operation continue and log the error. In all likelihood it's
a view-related problem, and that shouldn't cause any data operation to
fail.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
bd0050b6c6 Cache messages on receipt, remove from cache when processed
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
8112cd220a Show warning when we discover key change on verify
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
91f50c028f Unify processVerifiedMessage with Java implementation
This removes our support for the New Key/DEFAULT case, which iOS will
sync to us. Why? Because it ensures that in out of date scenarios, we
don't lose the higher-security state we were in previously.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
d1a9b62077 test/index.html: Restore previous location of code coverage stuff
I changed the location when trying to get code coverage to work properly
and it turned out not to be necessary for the fix.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
c10e1b4ad0 Code coverage test run: Fix broken test
This test failed only under code coverage runs - because start up of the
page too took long!

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
5c990d2a35 Code coverage: Collect test coverage for the protocol layer
Because we were only doing a partial instrumentation run prior to this
change, un-instrumented code had references to un-instrumented code
(because Blanket's instrumentation re-runs the code once it is
instrumented, updating the window.NAME reference).

A big part of this was that libtextsecure was not instrumented. And for
good reason; it takes a long time to load and run, especially when
instrumented. But without covering it, we'll have an incomplete view
of our code coverage. So, all coverage collection remains off by
default.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
10f4f3fea5 Fix crash in keychange listener test
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
12914307f1 Improve experience when discovering identity key error on send
New experience in the Message Detail view when outgoing identity key
errors happen, matching the Android View.

'View' button is only shown on outgoing key errors right now.

When a contact with an outgoing identity key error is clicked, they are
taken to a view like the popup that comes up on Android: an explanation
of what happened and three options: 'Show Safety Number', 'Send Anyway',
and 'Cancel'

Contacts are now sorted alphabetically, with the set of contacts with
errors coming before the rest.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
b6cca41a0c Update verification-related strings to better match mobile app
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
f654532fa8 Handle UNVERIFIED sync verification messages (via contact sync)
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
20451cc827 Show verified/keychange notifications when actually relevant
FREEBIE
2017-08-04 12:03:25 -07:00
lilia
877f092b2c Fix tests
saveIdentity now requires a full protocol address string

// FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
0056cbefc1 processVerifiedMessage: Trigger keychange event when key differs
FREEBIE
2017-08-04 12:03:25 -07:00
lilia
5d5805526a Fix a test
Set the timestamp on the record to current time to ensure that
nonblockingApproval will be required.

// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
f15fadbb4d Test processVerifiedMessage 2017-08-04 12:03:25 -07:00
lilia
044e1560e0 Test new setVerified behavior
// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
33b4d398d6 Fix indentation 2017-08-04 12:03:25 -07:00
lilia
1e594e79c1 Fix test page template
// FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
16433d661a Show call to action on group member list when verifying
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
31bf05e14a Add verified state summary to top of safety number screen
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
11372b4e00 Add icons for keychange and expiration timer in-conversation items
The shield matches the Android app's key change notification, and the
clock icon was easy to do and makes it easier to visually distinguish
those items in the conversation history.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
c714fb6dbf Shadow/icon/blue for banner, better verify advisories in dark theme
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
1cf9289b1a Add items to conversation history when user verifies/unverifies
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
47c5142a83 Replace unicode check with new svg icon
A good bit of CSS was required to keep the text color changing along
with the text it is nestled within.

Also: took this opportunity to increase the contrast of the number and
verified section right under the contact name in the group members view.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
8264f3ba33 Make the term 'Verified' fully localizable
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
8d29cb9830 Prevent access to Safety Number when talking to yourself
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
c7e385eb38 Remove 'safety number approval' option from settings dialog
Also sync templates in test/index.html and background.html

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
243cbd8123 Confirmaton on send, banner when 'unverified'
Not yet using the new APIs, but ready to. Still to do:
- Send sync messages on trust decisions
- Respond to received trust decision sync messages
- Show trust decisions in the conversation history
- In that rare situation where a sent message ends up with a key error
  make it easy to retry the send.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
bedf10056b Support for group-member verifications via second-level panel
Also:
- All the necessary wire-up to update things in real time. If you have
a safety number page up via a group member view as well as via a 1:1
conversation with that contact, they'll both be updated as the
underlying model changes. Similarly, the overall group will update
in real-time as members change.
- A bit of special-casing for yourself in a group conversation - you're
shown as 'me' and are not clickable, where normally that would take you
to the Safety Number screen for that contact. You are also not included
in the trust calculations for a given group.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
ae3587f05e Move all instances of 'verify identity' to 'show identity'
As discussed in standup this morning - only the act of verifying or a
statement about current status should use that word 'verify.'

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
ee0b0f5ffb Remove all concept of 'key conflict' from the app 2017-08-04 12:03:25 -07:00
lilia
51080141cd Update identity store tests
// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
27692b4dfc Normalize whitespace in storage tests
// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
c6bfdec84d Remove blockingApproval
// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
1eec94dbb7 Update tests for saveIdentity
// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
ba3a6efb12 Add tests for all the new isTrusted behaviors
// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
2584f4fae4 Fix tests
// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
82469713d2 Update saveIdentity
Add support new blockingApproval and nonblockingApproval arguments
Populate the firstUse property on identity key records
Return whether an existing record was overwritten.

References
https://github.com/WhisperSystems/Signal-Android/commit/39d4a7#diff-69ede72c549da6bcbcd959935995b7e9R45

// FREEBIE
2017-08-04 12:03:25 -07:00
Heather Booker
5a3610c8e0 Specify font-family for identicon in notification
Fixes #904, where letters in notification bubbles were being
displayed in serif font on Antergos (Arch) OS.

// FREEBIE
2017-07-12 15:35:53 -07:00
Scott Nonnenberg
1775e97bcd Add comment and fine-tune last-seen indicator when not focused
FREEBIE
2017-06-01 16:09:27 -07:00
Scott Nonnenberg
5194b8816e Update manual test script with updated scrolling/unread behavior
FREEBIE
2017-06-01 16:09:27 -07:00
Scott Nonnenberg
0d722a3186 Last seen indicator visual refresh
- Last seen indicator now spans the full conversation, with subtle
shadow highlights above and below
- Scrollbars now overlap the content of the conversation, allowing last
seen indicator to touch the right edge of the window.
- The iOS and Android conversation background is now #eee instead of
white, which meant that the outgoing messages (Android) and incoming
messages (iOS) had to be updated for contrast. They now have white
backgrounds.
- Similarly, the scroll down button needed more contrast, and its
background is now white in light themes.

FREEBIE
2017-06-01 15:19:25 -07:00
Scott Nonnenberg
10a6dc8b6f Update manual test script to reflect scroll/last-seen updates
FREEBIE
2017-05-25 16:41:21 -07:00
Scott Nonnenberg
01918049b4 Keep last seen indicator around for five seconds
Helps calm the user experience a little more, makes it easier to
understand what's happening when messages are coming in quickly.

FREEBIE
2017-05-25 16:41:21 -07:00
Scott Nonnenberg
be981d6f48 Update manual test script after changes to last seen indicator
FREEBIE
2017-05-23 11:08:23 -07:00
lilia
16f3717824 Move refresh prekeys out of SignalProtocolStore
Use an event/listener instead

// FREEBIE
2017-05-23 11:08:23 -07:00
lilia
017bb56cca Fix some corner casese with last seen indicator
* Remove increment behavior
* Dismiss when new messages arrive but the window is focused
* Update the indicator when window becomes focused.

// FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg
ae7044fd30 Add recursive fetch scenario to manual test script
FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg
533ec52d0c test/manual.txt: add scenarios for new scroll down button
FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg
4c7bfbe9ff Scroll down button: when scrolled up, or new non-visible message
FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg
13322c7071 test/fixtures.js: Cleanup - data at top, images/setup at bottom
FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg
86c866738f Introduce unread message to fixtures, further interactivity fixes
FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg
318162e74a LastSeenIndicatorView: programmatic tests, tweak to manual tests
FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg
1608acf449 Add new test/manual.txt with scenarios for last-seen, scrolling
FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg
33cdc6ae71 test/index.html: Comments to help in turning off code coverage
FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg
0a5960e091 Restore interactivity to InboxViews hosted on test page
FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg
3cfac58d78 Eliminate all console errors during test run
FREEBIE
2017-05-23 11:08:23 -07:00
lilia
dc680126df Clean up key change listener tests
camelCase variables

// FREEBIE
2017-05-12 15:52:06 -07:00
lilia
534ba3a62f Remove unneeded promise wrapper
// FREEBIE
2017-05-12 15:52:06 -07:00
Scott Nonnenberg
0496518af4 Bulletproof getCountOfAllMatches against non-global regex input
FREEBIE
2017-05-10 15:51:39 -07:00
Scott Nonnenberg
423a0fef67 Jumbomoji support matching Android support
FREEBIE
2017-05-10 15:51:39 -07:00
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
2017-05-09 15:41:41 -07:00
Scott Nonnenberg
731fcb8ecb Add test verifying that AttachmentView shows file size
FREEBIE
2017-05-09 15:14:20 -07:00
lilia
40af226a4a Move Whisper.events out of views and tests 2017-04-21 13:21:18 -07:00
lilia
6c7e1aa283 Update tests 2017-04-18 16:27:50 -07:00
lilia
d0448ec778 Fix tests
// FREEBIE
2017-04-13 13:15:42 -07:00
Sam Vevang
ed4991974b set up a new view for displaying the network status
// FREEBIE
2017-04-08 00:10:56 -07:00
Blake Griffith
1e498294e0 Add attachment_views_test.js tests 2017-02-06 21:23:35 -08:00
Ikarulus
53cd3af78b Added a dark theme
I added a dark theme in order to solve #328.
This may fix #328 at least partially.
2016-12-02 00:41:42 +01:00
lilia
224afdd063 Fix tests 2016-10-07 19:39:50 +09:00
2-4601
669338c717 i18n 'Theme'
// FREEBIE
2016-10-07 19:27:05 +09:00
lilia
1fa722624e Fix tests 2016-09-23 20:15:47 -07:00