Commit Graph

473 Commits

Author SHA1 Message Date
Scott Nonnenberg d75d823873 package.json: Lock all dependencies to specific versions 2018-11-26 15:26:04 -08:00
Scott Nonnenberg 7d54f7928d v1.18.0-beta.7 2018-11-12 17:56:27 -08:00
Scott Nonnenberg 59d048ca06 v1.18.0-beta.6 2018-11-07 17:24:51 -08:00
Scott Nonnenberg 8391f6ec4e v1.18.0-beta.5 2018-11-01 17:24:07 -07:00
Scott Nonnenberg 3f3c63a46f v1.18.0-beta.4 2018-10-31 17:53:03 -07:00
Scott Nonnenberg 0a6827ecda v1.18.0-beta.3 2018-10-29 15:40:52 -07:00
Scott Nonnenberg 817cf5ed03 v1.17.2-beta.1 2018-10-26 15:15:47 -07:00
Scott Nonnenberg ad6f7f35a4 v1.17.1-beta.1 2018-10-24 15:19:28 -07:00
Scott Nonnenberg f01c5f3e68 v1.17.0-beta.4 2018-10-18 16:07:52 -07:00
Scott Nonnenberg c5908052ec v1.17.0-beta.3 2018-10-15 17:33:32 -07:00
Scott Nonnenberg 5e5fa13719 v1.17.0-beta.2 2018-10-11 12:50:10 -07:00
Scott Nonnenberg 3bd95a2ff6 v1.17.0-beta.1 2018-10-03 12:23:30 -07:00
Scott Nonnenberg 8cd3db0262 v1.16.2-beta.2 2018-09-20 16:07:20 -07:00
Scott Nonnenberg 79ebec36ca v1.16.2-beta.1 2018-09-20 15:40:24 -07:00
Scott Nonnenberg ecb126e74c
Custom linter to check code quality (#2753) 2018-09-20 15:24:52 -07:00
Scott Nonnenberg 366401f77a v1.16.1-beta.2 2018-09-17 16:22:15 -07:00
Scott Nonnenberg cfe561b3eb v1.16.1-beta.1 2018-09-06 16:02:02 -07:00
Scott Nonnenberg f3b6161c75 v1.16.0-beta.1 2018-08-29 11:01:23 -07:00
Scott Nonnenberg 998c35dcb3 Split configuration into low and high traffic files
Also, we're now handling config ourselves instead of using
electron-config and config dependencies.
2018-08-29 10:40:16 -07:00
Scott Nonnenberg f59ec92fef Routine update to Electron v2.0.8 2018-08-28 13:54:03 -07:00
Scott Nonnenberg 816228fde0 v1.15.4-beta.1 2018-08-10 15:02:43 -07:00
Scott Nonnenberg 61429090ff v1.15.3-beta.1 2018-08-07 19:01:26 -07:00
Scott Nonnenberg a771546ee8 v1.15.2-beta.1 2018-08-07 08:30:18 -07:00
Scott Nonnenberg f926a08aa8 v1.15.1-beta.1 2018-08-06 18:37:23 -07:00
Scott Nonnenberg 6e193456f9 Eliminate orphaned external message files on startup
Attachments, visual attachment thumbnails, video attachment screenshots
Quote thumbnails
Contact avatars
2018-08-06 18:08:10 -07:00
Scott Nonnenberg 185c05ceba v1.15.0-beta.10 2018-08-02 22:39:22 -07:00
Scott Nonnenberg 9dd756f96a v1.15.0-beta.9 2018-08-02 19:24:37 -07:00
Scott Nonnenberg e13f431456 Build libcrypto.a on Ubuntu 14.04 for maximum compatibility 2018-08-02 19:12:18 -07:00
Scott Nonnenberg fe84e92359 node-sqlcipher update: always build, statically link openssl 2018-08-02 17:32:51 -07:00
Scott Nonnenberg 8833326b08 v1.15.0-beta.8 2018-08-01 13:30:23 -07:00
Scott Nonnenberg ce2f3bd3c4 Statically compile openssl into sqlcipher for linux targets 2018-08-01 10:58:26 -07:00
Scott Nonnenberg 81df1807e8 v1.15.0-beta.7 2018-07-31 17:46:28 -07:00
Scott Nonnenberg 3105b77475 Migrate to SQLCipher for messages/cache
Quite a few other fixes, including:
  - Sending to contact with no avatar yet (not synced from mobile)
  - Left pane doesn't update quickly or at all on new message
  - Left pane doesn't show sent or error status

Also:
 - Contributing.md: Ensure set of linux dev dependencies is complete
2018-07-31 17:08:45 -07:00
Scott Nonnenberg fc461c82ce v1.15.0-beta.6 2018-07-27 11:21:18 -07:00
Scott Nonnenberg 8f6f24e958 v1.15.0-beta.5 2018-07-21 15:44:44 -07:00
Scott Nonnenberg 4320b125dd v1.15.0-beta.4 2018-07-20 16:50:48 -07:00
Scott Nonnenberg e23fcab7e8 v1.15.0-beta.3 2018-07-19 11:08:46 -07:00
Scott Nonnenberg 356fac8d14 v1.15.0-beta.2 2018-07-18 20:01:26 -07:00
Scott Nonnenberg d97a7eabf8 v1.15.0-beta.1 2018-07-18 14:14:45 -07:00
Scott Nonnenberg 3c69886320 Finish new Message component, integrate into application
Also:
- New schema version 8 with video/image thumbnails, screenshots, sizes
- Upgrade messages not at current schema version when loading messages
  to show in conversation
- New MessageDetail react component
- New ConversationHeader react component
2018-07-17 15:58:07 -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
Scott Nonnenberg a689d430d2 v1.14.1-beta.1 2018-07-13 12:07:02 -07:00
Scott Nonnenberg d014fa779e v1.14.0-beta.3 2018-07-12 17:05:28 -07:00
Scott Nonnenberg 9b04c8ecf3 v1.14.0-beta.2 2018-07-12 13:05:57 -07:00
Scott Nonnenberg 8776b376f6 Ensure that the production build has permissions_popup_preload.js 2018-07-12 13:03:17 -07:00
Scott Nonnenberg b385489a44 v1.14.0-beta.1 2018-07-12 11:48:52 -07:00
Scott Nonnenberg ad4387803b New media permission, show dialog when not enabled for voice msg
UI now in separate renderer:
  - the permissions popup
  - settings dialog
  - debug log dialog
  - about window

Couple bug fixes:
  - About Window: Fix 'escape' to close window
  - Remove outdated dist/copy tasks from Gruntfile

Eslintified settings_view.js
2018-07-03 16:04:21 -07:00
Scott Nonnenberg e83e10a7d1
Include about_preload.js in production builds (#2485) 2018-07-03 15:03:13 -07:00
Scott Nonnenberg bd13939548 v1.13.0-beta.2 2018-06-21 16:15:01 -07:00
Scott Nonnenberg 8eeaad8e18 Remove unused export/import functionality 2018-06-21 11:54:01 -07:00
Scott Nonnenberg 4ccddeaccc v1.13.0-beta.1 2018-06-14 17:14:44 -07:00
Scott Nonnenberg 6dd93271d9 v1.12.0-beta.2 2018-05-31 14:22:13 -07:00
Scott Nonnenberg 41c8dbc4f9 v1.12.0-beta.1 2018-05-23 17:29:50 -07:00
Scott Nonnenberg ec3e36824c Remove jscs from the project 2018-05-23 16:26:48 -07:00
Scott Nonnenberg cfe0bd0e79 Move to npm for several dependencies
mustache
jQuery
underscore
backbone
mocha
chai
intl-tel-input
2018-05-23 16:26:48 -07:00
Scott Nonnenberg 2988da0981 Turn on all of Microsoft's recommend lint rules
Biggest changes forced by this: alt tags for all images, resulting in
new strings added to messages.json, and a new i18n paramter/prop added
in a plot of places.

Another change of note is that there are two new tslint.json files under
ts/test and ts/styleguide to relax our rules a bit there. This required
a change to our package.json script, as manually specifying the config
file there made it ignore our tslint.json files in subdirectories
2018-05-23 16:26:47 -07:00
Scott Nonnenberg 91c247ef8d Move all forks to @scottnonnenberg-signal account 2018-05-23 12:26:17 -07:00
Scott Nonnenberg e02887565b
Update to electron v2.0.1 (#2401)
* Remove extra parenthesis causing warnings on latest chromium

* Update to electron 2.0.1

* Move all @types dependencies to devDependencies

* Update electron-builder/electron-updater

* Update to Node.js 8.9.3 to match Electron 2.0.1
2018-05-23 12:17:58 -07:00
Scott Nonnenberg 877cbfc338 v1.11.0-beta.5
Fix broken CSP
2018-05-14 16:45:50 -07:00
Scott Nonnenberg e52c7ca2f3 v1.11.0-beta.4
Move to react for newlines, emoji, and links in message body
2018-05-14 16:09:37 -07:00
Scott Nonnenberg 4e5c8965ff Move to react for newlines, emoji, and links in message body 2018-05-14 16:09:37 -07:00
Scott Nonnenberg 721935b0c8 v1.11.0-beta.3
Update link handling
2018-05-11 13:52:24 -07:00
Scott Nonnenberg d8e0a489b2 v1.11.0-beta.2
Notification Improvements (#2364)
  - Fixed: The change for production didn't full make it into v1.11.0-beta.1 - this change restores the code which removes the old notification when we add a new one
  - Fixed: Notifications could be orphaned in notification center if they were added/removed quickly
  - Fixed: Notifications weren't removed properly when read on a linked device

Dev: Better logging when we receive a read sync from a linked device (#2364)
2018-05-10 18:07:50 -07:00
Scott Nonnenberg d9685178d2 v1.11.0-beta.1
Feature: Receive contact (#2349, #2359)

Fixed: Sometimes clicks on quoted message wouldn't work (#2350)

Fixed: In dark theme, it was hard to see a message's triple-dot menu on hover - thanks @PunkChameleon (#2334)

Fixed: Unsupported image and video types were missing from media pane (#2351)

Fixed: On small screens, the media lightbox view would show media off-screen (#2351)

Notification improvements
  - Remove all on remote read, on focus, on exit
  - Show multi-message notifications like '5 new messages'

Media Gallery: A number of small visual fixes (#2351)

Emoji pane: Can now dismiss it by pressing escape key - thanks @tommypacker (#2354, #2357)

Update translations (#2328, #2352)

Dev:
  - Windows 7: Use Electron-native notifications (#2338, #2330)
  - Improve Logging For Disappearing Messages (#2332)
  - Prettier: Continue expanding its coverage of app (#2339, #2324)
  - Document Translations Setup + Remove Unused Strings (#2329)
  - Make Protocol Buffers available to commonjs code (#2347)
2018-05-10 12:16:43 -07:00
Scott Nonnenberg 41be7f126b Visuals for embedded contacts as well as contact detail screen 2018-05-07 19:09:55 -07:00
Daniel Gasienica ba4d8952c6 Revert "Use protocol buffer module for `libtextsecure`"
This does not work with `ArrayBuffer` out of the box and will need to be
investigated and tested more before switching.

Some APIs also seemed to have changed:
- Before (OOP): `new textsecure.protobuf.WebSocketMessage(…).encode();`
- After (functional):
  ```
  textsecure.protobuf.WebSocketMessage.encode(
    new textsecure.protobuf.WebSocketMessage(…)
  );
  ```

This reverts commit d758119d9de4f99742ea941e86180b1d600c2f22.
2018-05-07 21:53:41 -04:00
Daniel Gasienica 60077d0b7b Use protocol buffer module for `libtextsecure` 2018-05-07 21:53:40 -04:00
Daniel Gasienica daa4a3d63f Compile all protocol buffers 2018-05-07 21:53:40 -04:00
Daniel Gasienica 086c64deb8 Add `yarn clean-protobuf` command 2018-05-07 21:53:40 -04:00
Daniel Gasienica 55f85465c6 Remove generated protobuf as part of `yarn clean-transpile` 2018-05-07 21:53:40 -04:00
Daniel Gasienica cb09da0f63 Run all build steps in CI 2018-05-07 21:53:40 -04:00
Daniel Gasienica 2d95745d56 Add `yarn build-protobuf` command 2018-05-07 21:53:39 -04:00
Daniel Gasienica 58399549c3 Add `protobufjs` dependency 2018-05-07 21:53:39 -04:00
Daniel Gasienica 8ee250d37e Prettier: Format CSS, SCSS, and JSON 2018-05-04 16:32:08 -04:00
Daniel Gasienica 38b23c6627 Add `@types/semver` 2018-05-02 20:01:56 -04:00
Daniel Gasienica 0b4c60c272 Add `@types/sinon` 2018-05-02 19:58:33 -04:00
Daniel Gasienica e3191c9017 Remove `node-notifier` 2018-05-02 19:58:33 -04:00
Scott Nonnenberg 754d65ae2e Let's make it all pretty, shall we?
We missed a couple directories with previous attempts to turn this on
globally: app/ and libtextsecure/

Not to mention files in places we didn't expect: ts files that weren't
in the ts directory!

This turns prettier on for every file we care about (js, ts, tsx, md)
everywhere in the project but for a few key parts.
2018-05-02 13:40:57 -07:00
Scott Nonnenberg 322d307655 Turn on prettier support for markdown files, update all files 2018-05-01 16:06:57 -07:00
Scott Nonnenberg cea77418ec Remove unused asarl package.json script, rearrange a little 2018-05-01 09:49:22 -07:00
Scott Nonnenberg 167f54f37f Remove unused build assets
Linux: deb (dropped zip)
Mac: zip (dropped dmg)
Windows: exe (dropped zip)

We can always re-add if people are relying on these things. But our
download links all point to these assets, so we'll generate and upload
only these for now.
2018-05-01 09:47:10 -07:00
Scott Nonnenberg 58fddc4e9d Remove electron builder support for publishing to S3
We do this ourselves now.
2018-05-01 09:46:36 -07:00
Scott Nonnenberg 50eb82fa6a package.json: Remove all but the scripts needed for modern build 2018-04-30 22:36:21 -07:00
Scott Nonnenberg af94c67e42 v1.10.0-beta.1
Media Gallery showing all attachments in a given conversation (#2291, previous: #2236)

Quotes:
  - Show 'You' in Android theme instead of your own contact name (#2312)
  - Show thumbnails for quotes of messages with video attachments (#2293)

Video attachments: show first frame preview in composition area (#2293)

Increase speed of migration to move attachments to disk from database (#2314)

Dev:
  - Add comments clarifying our mechanisms for stripping EXIF info (#2313)
  - Move to prettierjs to format our code (#2303)
  - Fix break in styleguide; make filesize/Signal.Util.GoogleChrome available (#2302)
  - Remove duplicate entry from .gitignore (#2271)
2018-04-30 17:06:44 -07:00
Daniel Gasienica 522bd57ec3 Run `yarn lint-windows` without Prettier for AppVeyor
We need to figure out how to run globs on Windows.
2018-04-30 18:13:30 -04:00
Daniel Gasienica 1d867d784d Decouple `yarn format` from `yarn format-check`
Checking if that fixes Windows CI issue.
2018-04-30 17:33:58 -04:00
Daniel Gasienica 428984c8e2 Include Prettier as part of `yarn lint` 2018-04-30 16:53:34 -04:00
Daniel Gasienica 97dfffd2b0 Add `.prettierrc.js` 2018-04-30 16:53:34 -04:00
Daniel Gasienica aa7665e497 Run Prettier on all source files 2018-04-30 16:52:43 -04:00
Daniel Gasienica 1bf3ab630c Add `eslint-config-prettier` 2018-04-30 16:52:43 -04:00
Scott Nonnenberg b9b85a0030
v1.9.0-beta.1
Send quoted replies via hover menu on message (#2284, #2292)

Fixed: Linking a new iOS device would not initially show iOS theme (#2284)

Fixed: In iOS theme, narrow images would result in a broken chat bubble (#2273, #2282)

Dev:
  - Fix beta install instructions in readme for debian-based linux (#2262)
  - Media Gallery: Phase 1 - currently disabled (#2236)
2018-04-25 13:01:54 -07:00
Daniel Gasienica 5ec8b1c6e1 Add `@types/jquery` 2018-04-25 15:24:51 -04:00
Daniel Gasienica dea56c0008 Autoformat TSX files 2018-04-25 15:24:51 -04:00
Daniel Gasienica 2fae89f0e8 Add trailing commas to autoformatted code 2018-04-25 15:24:51 -04:00
Daniel Gasienica 347fc8287a Add `yarn format` to autoformat code
Uses Prettier under the hood. Requires opt-in via `@prettier` pragma:
https://prettier.io/docs/en/options.html#require-pragma
2018-04-25 15:24:51 -04:00
Daniel Gasienica 56a5006392 Remove duplicate `@types/lodash` dependency 2018-04-25 15:24:51 -04:00
Daniel Gasienica 3a8c3ccdab Add `prettier` 2018-04-25 15:24:51 -04:00
Daniel Gasienica 8ef04cb1fd Move `@types/*` dependencies to `devDependencies` 2018-04-25 15:24:51 -04:00
Daniel Gasienica 10bede85c9 Add `filesize` dependency 2018-04-25 15:24:50 -04:00
Daniel Gasienica 9533c09707 Add `@types/lodash` 2018-04-25 15:24:50 -04:00
Scott Nonnenberg a7d44d3344
Backup and end-to-end test! 2018-04-20 15:24:04 -07:00
Scott Nonnenberg 3dbc550db2
v1.8.0-beta.1
Receive quoted replies (#2244)

iOS theme: one bubble for both attachment and message contents (#2244)

Improve URL Auto-Linking In Messages (#2240)

Redact More Variants Of Paths In Stack Traces (#2229)

Fixed: Conversation message preview would sometimes continue to show after message disappeared (1206b3c448)

Dev: Introduce React, TypeScript, TSLint and React-StyleGuidist (#2219 and #2232)
2018-04-16 13:14:18 -07:00
Scott Nonnenberg 21bf02c94d
Fixed examples in Quote.md, rough Android visuals 2018-04-13 18:05:44 -07:00
Daniel Gasienica 560cc4e149 Set dynamic parameter last 2018-04-11 19:46:23 -04:00
Daniel Gasienica 9d159da79c Add Microsoft contributed TSlint rules: `tslint-microsoft-contrib` 2018-04-11 19:45:31 -04:00
Daniel Gasienica 55fc21505e Rename `ts/test` to `ts/styleguide` 2018-04-11 16:36:42 -04:00
Daniel Gasienica 99dbdc3506 Include compiled TypeScript JavaScript files in build 2018-04-11 16:36:42 -04:00
Daniel Gasienica d6436de3bd Organize npm scripts
Combine `yarn grunt jshint` and `yarn grunt jscs` into `yarn grunt lint`.
2018-04-11 16:36:42 -04:00
Daniel Gasienica 6f4d0e1449 Use project for TSLint 2018-04-11 16:36:42 -04:00
Daniel Gasienica 15d221ae0e Simplify testing and linting
Separate linting from testing as follows:

- `yarn jscs`: Run JSCS.
- `yarn jshint`: Run JSHint.
- `yarn lint`: Run all linters, i.e. ESLint, TSLint, JSHint, and JSHint.

- `yarn test-node`: Run Mocha tests in Node.js environment.
- `yarn test-electron`: Run tests in Electron environment via Grunt.
- `yarn test`: Run all tests.

CI
- Align Travis and AppVeyor scripts as much as possible.
- Run linting before tests to fail fast.
- Run Node.js (headless and fast) tests first.
- Run Electron tests last (Travis seems to require custom setup in `travis.sh`).
2018-04-11 16:36:42 -04:00
Daniel Gasienica d6b40a3e94 Explicitly point to TSLint configuration
AppVeyor seems to ignore our configuration.
2018-04-11 16:36:42 -04:00
Daniel Gasienica 9d41b86162 Remove escaping from `linkText`
We leverage jQuery’s HTML escaping in `$.html(…)`.
2018-04-11 16:36:42 -04:00
Daniel Gasienica d9381c543e Add `linkify-it` dependency 2018-04-11 16:36:42 -04:00
Daniel Gasienica 7d4ef9315b Add `yarn test-ts` 2018-04-11 16:36:42 -04:00
Daniel Gasienica 6f8dee402d Add `@types/mocha` 2018-04-11 16:36:42 -04:00
Daniel Gasienica 7ac4bee959 Add `@types/chai` 2018-04-11 16:36:42 -04:00
Daniel Gasienica 78ba4eddc1 Add `@types/lodash` 2018-04-11 16:36:42 -04:00
Daniel Gasienica f5641fe6d6 Add `link-text` dependency
It only has the minimum required dependencies:
- `linkify-it`: Best-in-class link detection library with support for
                Unicode/IDN.
- `escape-html`: Standalone dependency for escaping HTML.
- `uc.micro`: Standalone dependency of Unicode data files.
2018-04-11 16:36:42 -04:00
Scott Nonnenberg c6c3b65bbc
Introduce React, TypeScript, TSLint and React-StyleGuidist (#2219)
Quite a bit of change here.

First, the basics:

- New dependencies were added: react, typescript, tslint, and react-styleguidist
- A new npm script: transpile. It uses typescript to process .tsx files in js/react, putting .js files next to the original file. It's part of the watch functionality of grunt dev as well as the default task run with just grunt (used to build the app prior to release). A lighter-weight to get watch behavior when just working on React components is to run yarn transpile --watch.
- yarn run clean-transpile will remove generated .js files


Style guide via react-styleguidist. Example site: https://react-styleguidist.js.org/examples/basic/

- Start with yarn styleguide
- Component.md files right next to the .tsx file
- jsdoc-style comments are picked up and added to the generated part of the styleguide - the overall summary and a table listing methods and properties of the component
- It has hot-reloading!
- It uses webpack, which means that our app now pulls in webpack though we don't use it to generate anything for the production app.
- I did a bunch of work to enable the use of Backbone views in this context, which will allow us to move smoothly from the old world to the new. First, add all the permutations in the old way, and then slowly start to re-render those same views with React.

A bit of dependency cleanup to enable use in React components:

- moment was moved from our Bower dependencies to our npm dependencies, so it can be used in React components not running in a browser window.
- i18n was moved into the new commonjs format, so it can be used in React components even if window is not available.

Lastly, a bit of Gruntfile cleanup:

- Removal of Chrome App-era modifications of background.js
- Make jshint/jscs watch more targeted, since more and more we'll be using other tools
2018-04-06 08:13:00 -07:00
Scott Nonnenberg 23537546fe
Big refactor: ts/ directory for all typescript, including react
Split out test-specific and general utility react components too.

And moved our test/legacy* files for the Style Guide into a styleguide/
subdirectory of test/.

I think we'll be able to live in this directory structure for a while.
2018-04-05 15:30:40 -07:00
Scott Nonnenberg 1052341d79
Fix tslint errors and add tslint to CI task in package.json 2018-04-05 08:37:04 -07:00
Scott Nonnenberg be91a89d68
Parse theme from querystring, put on util. Moment from require()
We also fully set up i18n and put it on util as well as making
it available on windows.i18n for Backbone views.
2018-04-05 08:31:43 -07:00
Scott Nonnenberg ef6a0c1162
v1.7.0-beta.3
Update to electron 1.8.4 (#2186)

Migrate all attachments from IndexedDB to file system in the background (#2208, #2193, #2165, #2162, #2129)

Save attachments to disk when importing Chrome app export (#2212)

Fixed: Read receipts setting would not be synchronized along with re-link (#2218)

Fixed: Clicking conversation in left pane when already selected would remove focus on message composition field - thanks
@colefranz! (#2032)

Fixed: Searching for the phone number of an existing contact, then selecting 'start conversation' would erase contact details (#2191)

Fixed: Selecting Settings menu option multiple times would open multiple instances of settings view - thanks @navdeepsinghkhalsa (#2167)

Dev:
  - Relax Node.js version requirements (#2203)
  - Fix a few typos in documentation - thanks @Vinnl (#2171)
  - Update issue template to mention that translation should be via Transifex (#2157)
2018-04-04 17:13:23 -07:00
Scott Nonnenberg 1326b26585
Full styleguide now available via `yarn styleguide`
Due to a number of hacks, the style guide can be used to show Backbone
views. This will allow a smooth path from the old way of doing things to
the new.
2018-04-04 16:08:38 -07:00
Scott Nonnenberg 893fb1cb9e
Introduce React/TypeScript/TSLint into app for new UI components
npm run transpile
  Works on files under js/react/
  Outputs files right next to the .tsx file

This is part of our `grunt dev` task, as well as the default grunt task,
which does everything else necessary to get a raw git checkout ready to
run.
2018-04-04 16:08:27 -07:00
Scott Nonnenberg 1ad2b080c8
Move moment from bower deps to npm deps 2018-04-04 16:00:38 -07:00
Daniel Gasienica 29832c445a Add `@sindresorhus/is` dependency
This will allow us to do runtime and, once we have TypeScript support,
compile-time type checks.
2018-04-04 17:40:19 -04:00
Daniel Gasienica 7d0871ee0e Run tests using `yarn` instead of `npm` 2018-04-03 11:45:11 -04:00
AJ Jordan 81ac6a9031
Don't lock the Node version so strictly
This is particularly problematic because Yarn apparently
errors (not warns) if the engine doesn't match.
2018-04-02 00:42:58 -04:00
Scott Nonnenberg 4e6d1e128f
Update to electron 1.8.4 (#2186) 2018-03-26 14:39:55 -07:00
Daniel Gasienica 7eaa6ef2f7 Remove `string-to-arraybuffer` dependency
The function is simple enough to inline and this allows us to reduce our
dependencies surface area.
2018-03-26 16:38:34 -04:00
Daniel Gasienica 232e906650 Remove `tmp` as dev dependency 2018-03-26 16:38:34 -04:00
Daniel Gasienica 19a70ad8b8 Add `to-arraybuffer` dependency
Used for converting Node.js buffers to `ArrayBuffer`.
2018-03-26 16:38:34 -04:00
Daniel Gasienica 0fc2868f0e Remove `tempy` dependency
We already use `tmp`.
2018-03-26 16:38:34 -04:00
Daniel Gasienica 14f58281bc Add `string-to-array-buffer` as dev dependency
Used for testing attachment data migration.
2018-03-26 16:38:34 -04:00
Daniel Gasienica 925ddbd7db Add `tempy` as dev dependency
Useful for creating random temporary directories for testing.
2018-03-26 16:38:34 -04:00
Daniel Gasienica 14422652c6 Add `fs-extra` as direct dependency
Allows us to use `fs` with promises. Turns out it’s already a
transitive dependency.
2018-03-26 16:38:34 -04:00
Scott Nonnenberg 0d105fc190
1.7.0-beta.2
Fixed: White block at bottom of conversation panel in iOS theme
(#2144 and #2153)

Fixed: Would attempt to rotate signed prekey every five seconds,
forever, after app discovers it is unlinked
(1c6d91b59c)

Dev:
  - Introduce IndexedDB index on `messages` store tracking
    `schemaVersion` (#2128)
  - Preparation for encrypted backups
    (cea42bde7d)
  - Updates to structure of exported data - messages.zip, flat list of
    attachments (6d8f4b7b6e)
2018-03-20 14:05:16 -07:00
Scott Nonnenberg 6d8f4b7b6e
Backup: zipped messages.json, flat attachments dir
Backup creates, in a target directory:
  - An attachments folder, with all attachments, each named for their
    parent message's id - a GUID. If there is more than one attachment
    in a given message,  each attachment beyond the first will end with
    '-N', zero-indexed.
  - A file named messages.zip. It contains exactly what went to disk in
    the original export code, but zipped up.

Export is now only 'light,' and in this new messages.zip format.

Import supports both the new format and the old format. If the target
directory has a messages.zip file, we'll treat it as the new format.

Next up: Encrypting attachments and the messages.zip!
2018-03-20 11:53:22 -07:00
Scott Nonnenberg bbbd527985
v1.7.0-beta.1
New option in settings: delete all application data
(383e02edc4)

Remove all configuration in database when we discover we are unlinked
(9acb189650)

Delete everything in database when we link with a different phone number
from previous link (9acb189650)

Windows: Delete all data on uninstall
(c8555974e4)

Dev:
  - Switch to a new service for debug logs, since GitHub is retiring
    anonymous gists (#2111)
  - Redact file paths in anything that goes to the log on disk (#2110)
  - When top-level process errors happen, don't show dialog with stack
    trace (#2110)
  - Add `nsp` to CI runs
    (fd056e1b4c)
  - Add eslint-plugin-mocha to disallow exclusive tests using *.only
    (#2110)
2018-03-16 11:32:03 -07:00
Scott Nonnenberg fd056e1b4c
Add nsp to dev dependencies and to travis and CI scripts 2018-03-14 14:42:13 -07:00
Scott Nonnenberg c8555974e4
Delete data on windows uninstall 2018-03-14 14:37:13 -07:00
Daniel Gasienica c317f34f67 Remove `ensure-error` and `clean-error` dependency
It potentially could leak information from serialized non-errors that are thrown
due to `util.inspect`.
2018-03-08 17:45:55 -05:00
Daniel Gasienica 96442967cc Add `eslint-plugin-mocha`
Allows us to set various lint rules for our tests.
2018-03-08 16:23:51 -05:00
Daniel Gasienica ef40dfa841 Use forked `electron-unhandled`
Omits use of `ensure-error` for privacy.

Before:
`Uncaught error or unhandled promise rejection: NonError: { private: true }`

After:
`Uncaught error or unhandled promise rejection: [object Object]`

Tested using:

```
setTimeout(() => {
  throw new Error('sync: booooom!');
}, 5000);

setTimeout(() => {
  Promise.reject(new Error('async: promise'))
}, 10000);

setTimeout(() => {
  Promise.reject({private: true});
}, 15000);
```
2018-03-08 16:23:51 -05:00
Daniel Gasienica 77e7e9ad4d Add `ensure-error` dependency 2018-03-08 16:22:38 -05:00
Daniel Gasienica 9e5fec1d81 Add `electron-unhandled` dependency 2018-03-08 16:22:37 -05:00
Daniel Gasienica 0810ea6909 Remove `superagent` dependency
We’ve replaced it with more modern and Node.js based `got`:
https://www.npmjs.com/package/got
2018-03-08 16:21:27 -05:00
Daniel Gasienica 04afb6a318 Add `form-data` dependency
Used for upload debug logs to S3.
2018-03-08 16:21:27 -05:00
Daniel Gasienica b4c6f6733b Add `got` dependency
The plan is to use this for our future HTTP needs as it is:
- modern
- promise based
- popular
- likely to support custom certificate authorities (CAs)

Chosen over the following alternatives:
- superagent (older, promises added later, potential lack of custom CA support)
- axios (no team experience with it; less popular than `got`)
- request (older, heavy-weight, promises not native)
- jQuery (old, trying to move away from jQuery altogether and move towards
  declarative UIs)
- `fetch` (too low-level, no native timeout support)
2018-03-08 16:21:27 -05:00
Daniel Gasienica e289479c6b Add `superagent` dependency
HTTP client with higher-level API than `fetch` and support for timeouts, etc.
2018-03-08 16:21:27 -05:00
Scott Nonnenberg 9b25e106dc
v1.6.0-beta.2
Upgrade to the latest version of Electron, 1.8.2 (#2066)

Replace custom notification sound with system sound (#2108)

Update menus (#2078 and #2099)
  - A few copy changes to make things clearer
  - Settings now available via the File (Windows/Linux) or Signal
    Desktop (macOS) OS menu
  - Eliminate the triple-dot menu in the top-center of the screen

Fix: Hitting enter after entering device name on install would not move
to next screen (#2085)

Dev:
  - Ensure consistent builds using `yarn --frozen-lockfile` (#2098)
  - Update code to match eslint-enforced formatting (#2077)
  - Upgrade to latest version of electron-builder and associated
    packages (#2066 and #2097)
2018-03-05 17:10:09 -08:00
Daniel Gasienica a98a7ba690 Add `sinon` dev dependency
Useful tool for testing: http://sinonjs.org/
2018-03-05 10:29:11 -05:00
Daniel Gasienica 59e59fb754 Remove new message audio notification
Bye, bye, dear Ka-Klunk!
2018-03-05 10:29:11 -05:00
Daniel Gasienica 3df22026ab UX Improvements: Global Menu & Copy Changes (#2078)
- [x] Removed ‘Restart Signal’ global menu item
- [x] Change _Click to create contact…_ to _Start conversation…_
- [x] Move global menu (top-left kebab) into OS menu bar,
      i.e. **Settings** > **Preferences…**
- [x] Add tests for OS menu bar templates
- [x] Fix bug with **Window** menu on macOS when showing setup options
- [x] Use _Title Case_ for all OS menu bar menu items for consistency

commit dedf7c9af0
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:53:42 2018 -0500

    Use ‘Title Case’ to be consistent with OS menus

    References:
    - Apple:
        - https://developer.apple.com/macos/human-interface-guidelines/menus/menu-anatomy/#menu-and-menu-item-titles
        - https://developer.apple.com/library/content/documentation/FinalCutProX/Conceptual/FxPlugHIG/TextStyleGuidelines/TextStyleGuidelines.html#//apple_ref/doc/uid/TP40013782-CH6-SW1
    - https://titlecaseconverter.com/

commit 3286da29b3
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:36:50 2018 -0500

    Fix bug for macOS ‘Window’ menu with setup options

commit 236a23d1ea
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:27:46 2018 -0500

    Test menus with included setup options

commit c5d5f5abb8
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:10:27 2018 -0500

    Move settings (‘Preferences’) into OS-level menu

    This reduces our reliance on custom UI until we have more design resources.

commit 027803f8f4
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:02:56 2018 -0500

    Prepare tests for menu with/without included setup

commit 9e2f006924
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 15:55:46 2018 -0500

    Destructure `includeSetup`

commit 6b2a1eccdf
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 15:55:14 2018 -0500

    🔤 `createTemplate` `options`

commit c2fecba34b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 12:49:55 2018 -0500

    Test menu for Windows and Linux

commit 60281b1af9
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 12:40:39 2018 -0500

    Add `yarn run test-app` command

commit 1a0489919c
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 12:40:29 2018 -0500

    Add test for `SignalMenu.createTemplate` on macOS

commit 9638b86c0f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 12:34:46 2018 -0500

    Make `createTemplate` pure

    Extracting `options.platform` makes it easier to test without having to
    stub `process.platform`.

commit 9c26404892
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:47:39 2018 -0500

    Extract `locale.load` `appLocale` & `logger` for testability

    This allows us to run this code in a non-Electron environment, e.g. Node.js
    Mocha test suite.

commit 710b22438d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:46:13 2018 -0500

    🔤 npm scripts

commit 9ae22937fb
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:45:30 2018 -0500

    Use 2-space indendation for `app` module tests

commit 22c26baf61
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:22:55 2018 -0500

    Prefer named exports

commit 9c95261952
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:22:46 2018 -0500

    🔤 Organize `require`s

commit 2f144d24d9
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:13:50 2018 -0500

    Remove existing global hamburger menu

    This will be replaced by a OS-level ‘Preferences’ menu.

commit f5adb374cb
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 26 18:40:54 2018 -0500

    Remove ‘Restart Signal’ menu from settings

    Apparently, this is a remnant from the Chrome web application.

commit d7a206bc8e
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 26 17:16:49 2018 -0500

    Clarify label for starting a new conversation

    When user a enters a number that is not a contact, we prompt them to start a new
    conversation.

commit 715a406436
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 26 16:46:26 2018 -0500

    Use ‘Enter name or number’ as prompt’

    This follows implementation of Android and recommendation from Alissa.
2018-03-02 15:59:39 -05:00
Daniel Gasienica a4c52b8d64
Upgrade to Electron 1.8.2 / Node.js 8.2.1 (#2066)
* Upgrade to Electron 1.8.2 / Node.js 8.2.1

* Update CI Node.js versions

* Make `engines` top-level property

This was accidentally included under `build` which is disallowed
by `electron-builder`.

* Refactor notification updates

Allows easier debugging through variable inspection.

* Use `appId` for Application User Model ID

Recommended in:
https://github.com/electron/electron/issues/10864#issuecomment-346229090

* Update `spectron` to 3.8.0

* Bump `electron-builder` based dependencies

* Use `config.extraMetadata` instead of `em`

Prevents `Unknown argument: em` error.

See: https://github.com/electron-userland/electron-builder/issues/2615

* Revert AUMID to be based on `packageJson.name`

In our build artifact `packageJson.build.appId` causes an NPE.
2018-03-02 14:43:03 -05:00
Scott Nonnenberg 3a334f3d8d
v1.6.0-beta.1
Note: This release is equivalent to v1.5.2

Fixed: If interrupted in the middle of an import, next registration
would leave that imported data in the database (#2072)

Fixed: In some cases on OSX, View menu would not have Debug Log option
(#2089)

Fixed: In import/registration flow, choosing View -> Debug Log would do
nothing (#2089)

Fixed: In some cases contact/group syncs would turn off disappearing
messages in all conversations (#2086)

Fixed: On initial setup, conversations with disappearing messages
enabled would be at the top of the conversation list (#2084)
2018-03-01 14:56:17 -08:00
Scott Nonnenberg fde0b785ae
v1.5.2
Fixed: In some cases on OSX, View menu would not have Debug Log option (#2089)

Fixed: In import/registration flow, choosing View -> Debug Log would do nothing (#2089)
2018-03-01 12:08:21 -08:00
Scott Nonnenberg e66cdf86e4
v1.5.1
Fixed: In some cases contact/group syncs would turn off disappearing
messages in all conversations (#2086)

Fixed: On initial setup, conversations with disappearing messages
enabled would be at the top of the conversation list (#2084)
2018-02-28 17:38:48 -08:00
Scott Nonnenberg 65787918bc
v1.5.0
_Note: Includes fixes from 1.4.0-beta.1 (never released to production),
1.5.0-beta.1, and one additional pull request (#2072)_

Update electron to 1.7.12 (#2029)

New design for import and install flows (#2053)

Support for 'light' imports, which bring just messages, contacts and
groups (#2053, #2072)

Set conversation disappearing messages state and contact block state on
initial link (#1980)

'Restart' -> 'Restart Signal' button in update dialog, thanks @StevenXL
(#2024)

Fixed: If app started offline, conversations would not open (#2064)

Fixed: Attached images would sometimes show up rotated improperly (#2040)

Fixed: Uncaught Exception: TypeError; 'getSize' (#2061)

Fixed: File paths with special characters could be shown in misleading
way

Fixed: incoming messages sometimes didn't appear at all (#2050)

Fixed: 'Cannot find module ./app/locale' error popup when attempting to
start another instance of the app on Windows (#2017)

Fixed: Setting NODE_ENV environment variable to 'development' would
point it at staging servers (#2010)

Dev:
  - Move ESLint environment configuration into `.eslintrc` (#2051)
  - Sync Protocol Buffers with `libsignal-service-java` (#2046)
  - Update to libsignal-protocol-javascript v1.3.0 (#2050)
  - Make our binary comparisons constant time (#2047)
  - Fix typo in issue template (#2020)
  - Update to new signal branding (#2018)
2018-02-26 16:11:45 -08:00
Scott Nonnenberg ae75390acc
v1.5.0-beta.1
New design for import and install flows (#2053)

Support for 'light' imports, which bring just messages, contacts and groups (#2053)

Fix: If app started offline, conversations would not open (#2064)

Fix: Attached images would sometimes show up rotated improperly (#2040)

Fix: Uncaught Exception: TypeError; 'getSize' (#2061)

Fix: File paths with special characters could be shown in misleading way

Dev:
  - Move ESLint environment configuration into `.eslintrc` (#2051)
  - Sync Protocol Buffers with `libsignal-service-java` (#2046)
2018-02-22 11:40:25 -08:00
Scott Nonnenberg 426dab85a2
New design for import/install, 'light' import (#2053)
- A new design for the import flow. It features:
  - Icons at the top of every screen
  - Gray background, blue buttons, thinner text
  - Simpler copy
- A new design for the install flow. It features:
  - Immediate entry into the QR code screen
  - Animated dots to show that we're loading the QR code from the server
  - Fewer screens: 1) QR 2) device name 3) sync-in-progress
- When not set up, the app opens directly into the install screen, which has been streamlined. The `--import` command-line argument will cause the app to open directly into the import flow.
- Support for two different flavors of builds - the normal build will open into the standard registration flow, and the import flavor will be exactly the same except during setup it will open directly into the import flow.
- A new design for the (dev-only) standalone registration view
- When these install sequences are active, the OS File menu has entries to allow you to switch the method of setup you'd like to use. These go away as soon as the first step is taken in any of these flows.
- The device name (chosen on initial setup) is now shown in the settings panel
- At the end of a light import, we hand off to the normal device link screen, starting at the QR code. On a full import, we remove the sensitive encryption information in the export to prevent conflicts on multiple imports.
- `Whisper.Backup.exportToDirectory()` takes an options object so you can tell it to do a light export.
- `Whisper.Backup.importFromDirectory()` takes an options object so you can force it to load only the light components found on disk. It also returns an object so you can tell whether a given import was a full import or light import.
- On start of import, we build a list of all the ids present in the messages, conversations, and groups stores in IndexedDB. This can take some time if a lot of data is in the database already, but it makes the subsequent deduplicated import very fast.
- Disappearing messages are now excluded when exporting
- Remove some TODOs in the tests
2018-02-22 10:40:32 -08:00
Daniel Gasienica a1ac810343 Security: Replace Unicode order overrides in attachment names
As a user, when I receive a file attachment, I want to have confidence that the
filename I see in the Signal Desktop app is the same as it will be on disk.

To prevent user confusion when receiving files with Unicode order override
characters, e.g. `test<LTRO>fig.exe` appearing as `testexe.gif`, we replace all
occurrences of order overrides (`U+202D` and `U+202E`) with `U+FFFD`.

**Changes**
- [x] Bump `Attachment` `schemaVersion` to 2.
- [x] Replace all Unicode order overrides in `attachment.filename`:
      `Attachment.replaceUnicodeOrderOverrides`.
- [x] Add tests for existing `Attachment.upgradeSchema`
- [x] Add tests for existing `Attachment.withSchemaVersion`
- [x] Add tests for `Attachment.replaceUnicodeOrderOverrides` positives.
- [x] Add `testcheck` generative property-based testing library
      (based on QuickCheck) to ensure valid filenames are preserved.

---

commit 855bdbc7e647e44f73b9e1f5e6d64f734c61169a
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 22 13:02:01 2018 -0500

    Log error stack in case of error

commit 6e053ed66aee136f186568fa88aacd4814b2ab07
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 22 12:30:28 2018 -0500

    Improve `upgradeStep` error handling

commit 8c226a2523b701cb578b2137832c3eaf3475bb2b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 22 12:30:08 2018 -0500

    Check for expected version before upgrade

    Prevents out of order upgrade steps.

commit 28b0675591e782169128f75429b7bab2a22307fa
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 22 12:29:52 2018 -0500

    Reject invalid attachments

commit 41f4f457dae9416dae66dc2fa2079483d1f127a9
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 22 12:29:36 2018 -0500

    Fix upgrade pipeline order

commit 3935629e91c49b8d96c1e02bd37b1b31d1180720
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 22 12:28:25 2018 -0500

    Avoid `_.isPlainObject`

    Attachments are deserialized from a protocol buffer and can have a
    non-plain-object constructor.

commit 39f6e7f622ff4885e2ccafa354e0edb5864c55d8
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 22 12:19:07 2018 -0500

    Define basic attachment validity

commit adcf7e3243cd90866cc35990c558ff7829019037
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 22 12:18:54 2018 -0500

    Add tests for attachment upgrade pipeline

commit 82fc4644d7e654eea9f348518b086497be2b0cb4
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 21 12:20:24 2018 -0500

    Favor `async` / `await` over `then`

commit 8fe49e3c40e78ced0b8f2eb0b678f4bae842855d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 21 12:19:59 2018 -0500

    Add `eslint-more` plugin

    This will enable us to disallow `then` in favor of `async` / `await`.

commit 020beefb25f508ae96cf3fc099599fbbca98802b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 21 11:31:49 2018 -0500

    Remove unnecessary `async` modifiers

commit 177090c5f5ad9836f0ca0a5c2f298779519e3692
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 21 11:30:55 2018 -0500

    Document `operator-linebreak` ESLint rule

commit 25622b7c59291cb672ae057c47e7327a564cca40
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 21 11:14:15 2018 -0500

    Prefix internal function with `_`

commit 6aa3cf5098df71e9b710064739ec49d74f81b7bf
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 16 19:00:07 2018 -0500

    Replace all Unicode order override occurrences

commit fd6e23b0a519bce3c12c5b9ac676bcd198034fed
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 16 17:48:41 2018 -0500

    Whitelist `testcheck` `check` and `gen` globals

commit 400bae9fac5078821813bc0ca17a5d7a72900161
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 16 17:46:57 2018 -0500

    🎨 Fix lint errors

commit da53d3960aa7aa36b7cc1fcff414c9e929c0d9fc
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 16 17:42:42 2018 -0500

    Add tests for `Attachment.withSchemaVersion`

commit ec203444239d9e3c443ba88cab7ef4672151072d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 16 17:42:17 2018 -0500

    Add test for `Attachment.upgradeSchema`

commit 4540d5bdf7a4279f49d2e4c6ee03f47b93df46bf
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 16 17:05:29 2018 -0500

    Rename `setSchemaVersion` --> `withSchemaVersion`

    Put the schema version first for better readability.

commit e379cf919feda31d1fa96d406c30fd38e159a11d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 16 17:03:22 2018 -0500

    Add filename sanitization to upgrade pipeline

commit 1e344a0d15926fc3e17be20cd90bfa882b65f337
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 16 17:01:55 2018 -0500

    Test that we preserve non-suspicious filenames

commit a2452bfc98f93f82bed48b438757af2e66a6af82
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 16 17:00:56 2018 -0500

    Add `testcheck` dependency

    Allows for generative property-based testing similar to Haskell’s QuickCheck.
    See: https://medium.com/javascript-inside/f91432247c27

commit ceb5bfd2484a77689fdb8e9edd18d4a7b093a486
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 16 16:15:33 2018 -0500

    Replace Unicode order override characters

    Prevents users from being tricked into clicking a file named `testexe.fig`
    that appears as `testexe.gif` due to a Unicode order override character.

    See:
    - http://unicode.org/reports/tr36/#Bidirectional_Text_Spoofing
    - https://krebsonsecurity.com/2011/09/right-to-left-override-aids-email-attacks/

commit bc605afb1c6af3a5ebc31a4c1523ff170eb96ffe
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 16 16:12:29 2018 -0500

    Remove `CURRENT_PROCESS_VERSION`

    Reintroduce this whenever we need it. We currently only deal with schema version
    numbers within this module.
2018-02-22 13:21:53 -05:00
Daniel Gasienica a0da73ca8d Auto-orient image attachments based on EXIF metadata
As described in #998, images are sometimes displayed with an incorrect
orientation. This is because cameras often write files in the native sensor byte
order and attach the `Orientation` EXIF metadata to tell end-user devices how to
display the images based on the original author’s capture orientation.

Electron/Chromium (and therefore Signal Desktop) currently doesn’t support
applying this metadata for `<img>` tags, e.g. CSS `image-orientation: from-
image`. As a workaround, this change uses the `loadImage` library with the
`orientation: true` flag to auto-orient images ~~before display~~ upon receipt
and before sending.

**Changes**
- [x] ~~Auto-orient images during display in message list view~~
  - [x] Ensure image is not displayed until loaded (to prevent layout reflow) .
- [x] Auto-orient images upon receipt and before storing in IndexedDB
      (~~or preserve original data until Chromium offers native fix?~~)
- [x] Auto-orient images in compose area preview.
- [x] ~~Auto-orient images in lightbox view~~
- [x] Auto-orient images before sending / storage.
- [x] Add EditorConfig for sharing code styles across editors.
- [x] Fix ESLint ignore file.
- [x] Change `function-paren-newline` ESLint rule from
      `consistent` to `multiline`.
- [x] Add `operator-linebreak` ESLint rule for consistency.
- [x] Added `blob-util` dependency for converting between array buffers,
      blobs, etc.
- [x] Extracted `createMessageHandler` to consolidate logic for
      `onMessageReceived` and `onSentMessage`.
- [x] Introduce `async` / `await` to simplify async coding (restore control flow
      for branching, loops, and exceptions).
- [x] Introduce `window.Signal` namespace for exposing ES2015+ CommonJS modules.
- [x] Introduce rudimentary `Message` and `Attachment` types to begin defining a
      schema and versioning. This will allow us to track which changes, e.g.
      auto-orient JPEGs, per message / attachment as well as which fields
    are stored.
- [x] Renamed `window.dataURLtoBlob` to `window.dataURLToBlobSync` to both fix
      the strange `camelCase` as well as to highlight that this operation is
      synchronous and therefore blocks the user thread.
- [x] Normalize all JPEG MIME types to `image/jpeg`, eliminating the
      invalid `image/jpg`.
- [x] Add `npm run test-modules` command for testing non-browser specific
      CommonJS modules.
- **Stretch Goals**
  - [ ] ~~Restrict `autoOrientImage` to `Blob` to narrow API interface.~~ Do
        this once we use PureScript.
  - [ ] ~~Return non-JPEGs as no-op from `autoOrientImage`.~~ Skipping
        `autoOrientImage` for non-JPEGs altogether.
  - [ ] Retroactively auto-orient existing JPEG image attachments in the
        background.

---

Fixes #998

---

- **Blog:** EXIF Orientation Handling Is a Ghetto:
    https://www.daveperrett.com/articles/2012/07/28/exif-orientation-handling-is-a-ghetto/
- **Chromium Bug:** EXIF orientation is ignored:
    https://bugs.chromium.org/p/chromium/issues/detail?id=56845
- **Chromium Bug:** Support for the CSS image-orientation CSS property:
    https://bugs.chromium.org/p/chromium/issues/detail?id=158753

---

commit ce5090b473
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 16 10:35:36 2018 -0500

    Inline message descriptors

commit 329036e59c
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 15 17:34:40 2018 -0500

    Clarify order of operations

    Semantically, it makes more sense to do `getFile` before `clearForm`
    even though it seems to work either way.

commit f9d4cfb2ba
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 15 17:18:26 2018 -0500

    Simplify `operator-linebreak` configuration

    Enabling `before` caused more code changes and it turns out our previous
    configuration is already the default.

commit db588997ac
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 15 17:15:59 2018 -0500

    Remove obsolete TODO

commit 799c881763
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 15 17:12:18 2018 -0500

    Enable ESLint `function-paren-newline` `multiline`

    Per discussion.

commit b660b6bc8e
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 15 17:10:48 2018 -0500

    Use `messageDescriptor.id` not `source`

commit 5e7309d176
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 16:29:01 2018 -0500

    Remove unnecessary `eslint-env`

commit 393b3da55e
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 16:19:17 2018 -0500

    Refactor `onSentMessage` and `onMessageReceived`

    Since they are so similar, we create the handlers using new
    `createMessageHandler` function. This allows us to ensure both synced and
    received messages go through schema upgrade pipeline.

commit b3db0bf179
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 16:18:21 2018 -0500

    Add `Message` descriptor functions

commit 8febf125b1
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 14:46:56 2018 -0500

    Fix typo

commit 98d951ef77
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 12:22:39 2018 -0500

    Remove `promises` reference

commit a0e9559ed5
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 12:22:13 2018 -0500

    Fix `AttachmentView::mediaType` fall-through

commit 67be916a83
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 12:03:41 2018 -0500

    Remove minor TODOs

commit 0af186e118
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 11:44:41 2018 -0500

    Enable ESLint for `js/views/attachment_view.js`

commit 28a2dc5b8a
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 11:44:12 2018 -0500

    Remove dynamic type checks

commit f4ce36fcfc
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 11:27:56 2018 -0500

    Rename `process` to `upgradeSchema`

    - `Message.process` -> `Message.upgradeSchema`
    - `Attachment.process` -> `Attachment.upgradeSchema`
    - `Attachment::processVersion` -> `Attachment::schemaVersion`

    Document version history.

commit 41b92c0a31
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 11:11:50 2018 -0500

    Add `operator-linebreak` ESLint rule

    Based on the following discussion:
    https://github.com/signalapp/Signal-Desktop/pull/2040#discussion_r168029106

commit 462defbe55
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 11:01:30 2018 -0500

    Add missing `await` for `ConversationController.getOrCreateAndWait`

    Tested this by setting `if` condition to `true` and confirming it works.
    It turns rotating a profile key is more involved and might require
    registering a new account according to Matthew.

commit c08058ee4b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 16:32:24 2018 -0500

    Convert `FileList` to `Array`

commit 70a6c42019
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 15:46:34 2018 -0500

    🎨 Fix lint errors

commit 2ca7cdbc31
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 15:07:09 2018 -0500

    Skip `autoOrientImage` for non-JPEG images

commit 58eac38301
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 14:55:35 2018 -0500

    Move new-style modules to `window.Signal` namespace

commit 02c9328877
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 14:35:23 2018 -0500

    Extract `npm run test-modules` command

commit 2c708eb94f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 13:25:51 2018 -0500

    Extract `Message.process`

commit 4a2e52f68a
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 13:25:12 2018 -0500

    Fix EditorConfig

commit a346bab5db
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 13:13:02 2018 -0500

    Remove `vim` directives on ESLint-ed files

commit 7ec885c635
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 13:08:24 2018 -0500

    Remove CSP whitelisting of `blob:`

    We no longer use `autoOrientImage` using blob URLs. Bring this back if we
    decide to auto-orient legacy attachments.

commit 879b6f58f4
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:57:05 2018 -0500

    Use `Message` type to determine send function

    Throws on invalid message type.

commit 5203d945c9
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:56:48 2018 -0500

    Whitelist `Whisper` global

commit 8ad0b066a3
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:56:32 2018 -0500

    Add `Whisper.Types` namespace

    This avoids namespace collision for `Whisper.Message`.

commit 785a949fce
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:55:43 2018 -0500

    Add `Message` type

commit 674a7357ab
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:35:23 2018 -0500

    Run ESLint on `Conversation::sendMessage`

commit cd985aa700
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:34:38 2018 -0500

    Document type signature of `FileInputView::readFile`

commit d70d70e52c
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:31:16 2018 -0500

    Move attachment processing closer to sending

    This helps ensure processing happens uniformly, regardless of which code
    paths are taken to send an attachment.

commit 532ac3e273
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:22:29 2018 -0500

    Process attachment before it’s sent

    Picked this place since it already had various async steps, similar to
    `onMessageReceived` for the incoming `Attachment.process`.

    Could we try have this live closer to where we store it in IndexedDB, e.g.
    `Conversation::sendMessage`?

commit a4582ae2fb
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:21:42 2018 -0500

    Refactor `getFile` and `getFiles`

    Lint them using ESLint.

commit 07e9114e65
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:37:31 2018 -0500

    Document incoming and outgoing attachments fields

    Note how outgoing message attachments only have 4 fields. This presumably
    means the others are not used in our code and could be discarded for
    simplicity.

commit fdc3ef289d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:36:21 2018 -0500

    Highlight that `dataURLToBlob` is synchronous

commit b9c6bf600f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:35:49 2018 -0500

    Add EditorConfig configuration

commit e56101e229
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:34:23 2018 -0500

    Replace custom with `blob-util` functions

    IMPORTANT: All of them are async so we need to use `await`, otherwise we get
    strange or silent errors.

commit f95150f6a9
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:17:30 2018 -0500

    Revert "Replace custom functions with `blob-util`"

    This reverts commit 8a81e9c01bfe80c0e1bf76737092206c06949512.

commit 33860d93f3
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:13:02 2018 -0500

    Revert "Replace `blueimp-canvas-to-blob` with `blob-util`"

    This reverts commit 31b3e853e4afc78fe80995921aa4152d9f6e4783.

commit 7a0ba6fed6
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:12:58 2018 -0500

    Replace `blueimp-canvas-to-blob` with `blob-util`

commit 47a5f2bfd8
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 10:55:34 2018 -0500

    Replace custom functions with `blob-util`

commit 1cfa0efdb4
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 10:47:02 2018 -0500

    Add `blob-util` dependency

commit 9ac26be1bd
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 10:46:44 2018 -0500

    Document why we drop original image data during auto-orient

commit 4136d6c382
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 10:46:27 2018 -0500

    Extract `DEFAULT_JPEG_QUALITY`

commit 4a7156327e
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 10:37:11 2018 -0500

    Drop support for invalid `image/jpg` MIME type

commit 69fe96581f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:54:30 2018 -0500

    Document `window.onInvalidStateError` global

commit a48ba1c774
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:54:04 2018 -0500

    Selectively run ESLint on `js/background.js`

    Enabling ESLint on a per function basis allows us to incrementally improve
    the codebase without requiring large and potentially risky refactorings.

commit e6d1cf826b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:16:23 2018 -0500

    Move async attachment processing to `onMessageReceived`

    We previously processed attachments in `handleDataMessage` which is mostly a
    synchronous function, except for the saving of the model. Moving the
    processing into the already async `onMessageReceived` improves code clarity.

commit be6ca2a9aa
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:14:49 2018 -0500

    Document import of ES2015+ modules

commit eaaf7c4160
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:14:29 2018 -0500

    🎨 Fix lint error

commit a25b0e2e3d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:13:57 2018 -0500

    🎨 Organize `require`s

commit e0cc3d8fab
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:07:17 2018 -0500

    Implement attachment process version

    Instead of keeping track of last normalization (processing) date, we now
    keep track of an internal processing version that will help us understand
    what kind of processing has already been completed for a given attachment.
    This will let us retroactively upgrade existing attachments.

    As we add more processing steps, we can build a processing pipeline that can
    convert any attachment processing version into a higher one,
    e.g. 4 -> 5 -> 6 -> 7.

commit ad9083d0fd
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:50:31 2018 -0500

    Ignore ES2015+ files during JSCS linting

commit 96641205f7
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:48:07 2018 -0500

    Improve ESLint ignore rules

    Apparently, using unqualified `/**` patterns prevents `!` include patterns.
    Using qualified glob patterns, e.g. `js/models/**/*.js`, lets us work
    around this.

commit 255e0ab15b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:44:59 2018 -0500

    🔤 ESLint ignored files

commit ebcb70258a
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:35:47 2018 -0500

    Whitelist `browser` environment for ESLint

commit 3eaace6f3a
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:35:05 2018 -0500

    Use `MIME` module

commit ba2cf7770e
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:32:54 2018 -0500

    🎨 Fix lint errors

commit 65acc86e85
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:30:42 2018 -0500

    Add ES2015+ files to JSHint ignored list

commit 8b6494ae6c
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:29:20 2018 -0500

    Document potentially unexpected `autoScale` behavior

commit 8b4c69b200
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:26:47 2018 -0500

    Test CommonJS modules separately

    Not sure how to test them as part of Grunt `unit-tests` task as
    `test/index.html` doesn’t allow for inclusion of CommonJS modules that use
    `require`. The tests are silently skipped.

commit 213400e4b2
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:24:27 2018 -0500

    Add `MIME` type module

commit 37a726e4fb
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 20:18:05 2018 -0500

    Return proper `Error` from `blobArrayToBuffer`

commit 164752db56
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 20:15:41 2018 -0500

    🎨 Fix ESLint errors

commit d498dd79a0
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 20:14:33 2018 -0500

    Update `Attachment` type field definitions

commit 141155a153
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 20:12:50 2018 -0500

    Move `blueimp-canvas-to-blob` from Bower to npm

commit 7ccb833e5d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:33:50 2018 -0500

    🎨 Clarify data flow

commit e7da41591f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:31:21 2018 -0500

    Use `blobUrl` for consistency

commit 523a80eefe
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:28:06 2018 -0500

    Remove just-in-time image auto-orient for lightbox

    We can bring this back if our users would like auto-orient for old
    attachments.

commit 0739feae9c
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:27:21 2018 -0500

    Remove just-in-time auto-orient of message attachments

    We can bring this back if our users would like auto-orient for old
    attachments. But better yet, we might implement this as database migration.

commit ed43c66f92
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:26:24 2018 -0500

    Auto-orient JPEG attachments upon receipt

commit e2eb8e36b0
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:25:26 2018 -0500

    Expose `Attachment` type through `Whisper.Attachment`

commit 9638fbc987
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:23:39 2018 -0500

    Use `contentType` from `model`

commit 032c0ced46
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:23:04 2018 -0500

    Return `Error` object for `autoOrientImage` failures

commit ff04bad851
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:22:32 2018 -0500

    Add `options` for `autoOrientImage` output type / quality

commit 87745b5586
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:18:46 2018 -0500

    Add `Attachment` type

    Defines various functions on attachments, e.g. normalization
    (auto-orient JPEGs, etc.)

commit de27fdc10a
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:16:34 2018 -0500

    Add `yarn grunt` shortcut

    This allows us to use local `grunt-cli` for `grunt dev`.

commit 59974db5a5
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 10:10:11 2018 -0500

    Improve readability

commit b5ba96f1e6
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 10:08:12 2018 -0500

    Use `snake_case` for module names

    Prevents problems across case-sensitive and case-insensitive file systems.

    We can work around this in the future using a lint rule such as
    `eslint-plugin-require-path-exists`.
    See discussion:
    https://github.com/signalapp/Signal-Desktop/pull/2040#discussion_r167365931

commit 48c5d3155c
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 10:05:44 2018 -0500

    🎨 Use destructuring

commit 4822f49f22
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 17:41:40 2018 -0500

    Auto-orient images in lightbox view

commit 7317110809
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 17:40:14 2018 -0500

    Document magic number for escape key

commit c790d07389
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 17:38:35 2018 -0500

    Make second `View` argument an `options` object

commit fbe010bb63
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 17:27:40 2018 -0500

    Allow `loadImage` to fetch `blob://` URLs

commit ec35710d00
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:57:48 2018 -0500

    🎨 Shorten `autoOrientImage` import

commit d07433e3cf
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:57:19 2018 -0500

    Make `autoOrientImage` module standalone

commit c285bf5e33
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:55:44 2018 -0500

    Replace `loadImage` with `autoOrientImage`

commit 4431854923
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:53:23 2018 -0500

    Add `autoOrientImage` module

    This module exposes `loadImage` with a `Promise` based interface and pre-
    populates `orientation: true` option to auto-orient input. Returns data URL
    as string.

    The module uses a named export as refactoring references of modules with
    `default` (`module.exports`) export references can be error-prone.
    See: https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html

commit c77063afc6
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:44:30 2018 -0500

    Auto-orient preview images

    See: #998

commit 06dba5eb8f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:43:23 2018 -0500

    TODO: Use native `Canvas::toBlob`

    One challenge is that `Canvas::toBlob` is async whereas
    `dataURLtoBlob` is sync.

commit b15c304a31
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:42:45 2018 -0500

    Make `null` check strict

    Appeases JSHint. ESLint has a nice `smart` option for `eqeqeq` rule:
    https://eslint.org/docs/rules/eqeqeq#smart

commit ea70b92d9b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 15:23:58 2018 -0500

    Use `Canvas::toDataURL` to preserve `ImageView` logic

    This way, all the other code paths remain untouched in case we want to
    remove the auto-orient code once Chrome supports the `image-orientation`
    CSS property.

    See:
    - #998
    - https://developer.mozilla.org/en-US/docs/Web/CSS/image-orientation

commit 62fd744f9f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 14:38:04 2018 -0500

    Use CSS to constrain auto-oriented images

commit f4d3392687
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 14:35:02 2018 -0500

    Replace `ImageView` `el` with auto-oriented `canvas`

    See: #998

commit 1602d7f610
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 14:25:48 2018 -0500

    Pass `Blob` to `View` (for `ImageView`)

    This allows us to do JPEG auto-orientation based on EXIF metadata.

commit e6a414f2b2
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 14:25:12 2018 -0500

    🔪 Remove newline

commit 5f0d9570d7
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 11:17:02 2018 -0500

    Expose `blueimp-load-image` as `window.loadImage`

commit 1e1c62fe2f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 11:16:46 2018 -0500

    Add `blueimp-load-image` npm dependency

commit ad17fa8a68
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 11:14:40 2018 -0500

    Remove `blueimp-load-image` Bower dependency
2018-02-21 10:28:13 -05:00
Scott Nonnenberg 3a159d5cb8
v1.4.0-beta.1
Update electron to 1.7.12 (#2029)

Fixed: incoming messages sometimes didn't appear at all (#2050)

Fixed: 'Cannot find module ./app/locale' error popup when attempting to
start another instance of the app on Windows (#2017)

Fixed: Setting NODE_ENV environment variable to 'development' would
point it at staging servers (#2010)

'Restart' -> 'Restart Signal' button in update dialog, thanks @StevenXL
(#2024)

Set conversation disappearing messages state and contact block state on
initial link (#1980)

Dev:
  - Update to libsignal-protocol-javascript v1.3.0 (#2050)
  - Make our binary comparisons constant time (#2047)
  - Fix typo in issue template (#2020)
  - Update to new signal branding (#2018)
2018-02-14 12:38:37 -08:00
Scott Nonnenberg 7ceeb8bac4
Update electron to 1.7.12 (#2029) 2018-02-02 10:04:38 -08:00
Scott Nonnenberg 7b49180bc0
Big update to new signal branding (#2018) 2018-01-30 14:22:51 -08:00
Scott Nonnenberg 9d9991e0f3
v1.3.0-beta.1
Update to Electron 1.7.11 (#1996)

Fixed: Crash during input via Chinese IME on Mac (#1996)

Fixed: Expired disappearing messages would sometimes remain in
conversation (#1983)
2018-01-25 10:57:41 -08:00
Scott Nonnenberg 5bb6b2f77f
Update to latest Electron 1.7.x (#1996)
Fixes #1991, related to IME input on Mac.
2018-01-23 13:48:30 -08:00
Scott Nonnenberg b2a3a0e679
v1.2.0-beta.2
Fixed: forwarded video would not play (#1977)

Fixed: conversation was inaccessible if group member had invalid phone
number (#1968)

Fixed: powershell warning caused cert validation of downloaded update to
fail on windows (#1976)

Fixed: 'Missing signed prekey' errors after re-link (#1979)

Add badge with unread count to the tray icon - thanks @m-pilia (#1934)
  Note: to try this test feature out, use the
   `--use-tray-icon` and `--start-in-tray` command-line arguments

Dev:
- Additional logging for sort of conversation list (#1969)
- Dependency updates, fixes required for successful release
  (#1966 and #1976)
- Log more info along with http errors (#1968)

Note: 1.2.0-beta.1 was never released - changes here:
  https://github.com/WhisperSystems/Signal-Desktop/releases/tag/v1.2.0-beta.1
2018-01-17 16:10:52 -08:00
Scott Nonnenberg 9ef8228ff8
Update electron-builder to latest, with .ico fix (#1976) 2018-01-17 15:27:18 -08:00
Scott Nonnenberg 177dfb3220
Dependency updates, fixes required for successful release (#1966)
* A number of fixes required for successful build after upgrades

- extract now takes an absolute directory only
- something changed, so we now need to force NODE_ENV=production; we use
  electron-is-dev for this
- electron-builder, electron-publisher-s3, and electron-updater are now
  updated to their latest available versions

* Add direct dependency on extract-zip, since we use it directly

* Load 'config' module after we've modified NODE_ENV

* Downgrade electron-builder due to bug, downgrade icon-maker too

The latest electron-builder came with a fix for one of our bugs as well
as a new bug that blocks builds on Windows: https://github.com/electron-userland/electron-builder/issues/2462

There's no good reason to upgrade icon-maker. And a good reason to keep at the version on github: https://github.com/jaretburkett/electron-icon-maker/issues/7
2018-01-12 16:14:45 -08:00
Scott Nonnenberg d81943cf20
v1.2.0-beta.1
Update to Electron 1.7.10 (#1919)

Fix issue where clicking Windows notification breaks window out of
aero-snap location (#1918)

Fix issue where old log data would persist in logs dir (#1945)

Fix issue where disabled send field (in the middle of send) could be
edited after click (#1937)

Update strings (#1921)

Dev:
  - Fix error to console when verifying contact in standalone mode
    (#1961)
  - Remove all built assets from repo (#1955)
  - Log out information from DOMException when import fails (#1923)
  - Log clearer messages regarding prekey/signed prekey fetches (#1961)
  - Make errors more debuggable; capture correct stack, include name
    (#1944)
  - Add eslint/mocha with code coverage for non-browser code (#1945)
  - Revamped github issue and pull request templates, updates to
    contributing.md/readme.md (#1955 and #1956)
  - Document building/testing releases in Contributing.md,
    thanks @veggiedefender (#1867)
  - Update a number of dependencies to the latest: builder, websocket,
    spellcheck (#1920)
2018-01-10 18:17:09 -08:00
Scott Nonnenberg d503d1ace3
Remove built assets from repo, updates to docs + GH templates (#1955)
* Revamp issue and pull request templates, other docs tweaks

`yarn test` now runs all of our tests.

* Remove generated files from the repository

* Update to new Signal support URL

* Prevent the 'Test failed 2 == 1' from test-release in CI

* Another attempt to fix grunt test-release on Appveyor

* grunt test-release: Fail build if test fails

* Lint fix, and move jshint earlier in CI process
2018-01-09 15:31:23 -08:00
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 94a8c7e524
Update a number of dependencies to the latest: builder, websocket, spellcheck (#1920)
* Update builder to the latest

* Upgrade a number of dependencies
2018-01-08 10:48:15 -08:00
Scott Nonnenberg 8fd0adc486
Update to Electron 1.7.10 (#1919) 2018-01-04 16:20:41 -08:00
Scott Nonnenberg 2bd27941c0
v1.1.0
Note: This release is the same thing as https://github.com/WhisperSystems/Signal-Desktop/releases/tag/v1.1.0-beta.6

Listed below are the changes from the previous production release: https://github.com/WhisperSystems/Signal-Desktop/releases/tag/v1.0.41

Update to electron 1.7.9 (#1736)

Support the latest phone number formats via libphonenumber update (#1899)

Reduce download size by ~25MB over the previous production build (#1869)

Emoji - thanks @liliakai:
  - Emoji picker (#1608)
  - Add support for Emoji 5 (#1797)

Notifications:
  - Windows 7: Use an alternate mechanism for notifications (#1812)
  - Prevent drawAttention() when notifications are turned off - thanks @canerelci! (#1612)

Linux:
  - Support for current (artful) and previous (xenial) ubuntu versions (#1856)
  - Fix missing application icon on some Linux distributions (#1735)
  - Fix issue where window would not show new message alerts on some Linux systems - thanks @cornerman (#1820)
  - Add .deb specific dependencies - thanks @veggiedefender (#1858)

The default button is now 'later', not 'restart' in the 'update available' dialog (#1894)

Make the window minimum width a little smaller - thanks @emptyflask (#1863)

Intl-friendly sort order for contact lists (#1900)

Fix issue where update would restore deleted windows shortcut (#1804)

Fix issue where .tif file attachments could not be sent or received (#1901)

(in testing) Add a tray icon to the application behind command-line argument - thanks @m-pilia (#1676)
  --use-tray-icon enables the tray icon
  --start-in-tray enables the tray icon and the application starts minimized in the tray bar

(in testing) Support pass-through proxies with HTTPS_PROXY environment variable (#1878)

Dev:
  - Display of environment and app instance in title bar/about window (#1606)
  - Support for beta releases installed beside production versions (#1606)
  - Fix json parsing exceptions obscuring server errors (#1605)
  - Be resilient to thrown non-errors in import process (#1737)
2017-12-20 10:47:21 -08:00
Scott Nonnenberg 250bd955a6
v1.1.0-beta.6
Fix issue where .tif file attachments could not be sent or received
(#1901)

Support the latest phone number formats via libphonenumber update
(#1899)

Intl-friendly sort order for contact lists (#1900)

Show window if hidden to tray when second instance attempts to start
(#1897)

Make the window minimum width a little smaller - thanks @emptyflask
(#1863)

Fix issue where duplicate emoji were listed in the emoji panel (#1893)

The default button is now 'later', not 'restart' in the
'update available' dialog (#1894)

Dev:
  - Add .deb specific dependencies - thanks @veggiedefender (#1858)
2017-12-14 17:47:41 -08:00
Scott Nonnenberg 5caee59921
Support the latest phone number formats via libphonenumber (#1899)
* Update to the latest google-libphonenumber

* Update package.json to the format uses when updating it
2017-12-14 16:30:24 -08:00
Jesse Li 8a919efbe9 Add .deb specific dependencies (#1858)
Some barebones debian-based systems (e.g. Docker containers) don't come with the libasound2 and libxss1 libraries, which electron-builder does not include by default.
2017-12-14 11:32:04 -08:00
Scott Nonnenberg 18ee8a3557
Remove obsolete emoji via a new fork of emoji-panel (#1893)
In many cases this removes generic emoji in favor of new gendered
options (one of which was a copy of the previous generic emoji anyway).
2017-12-14 11:30:41 -08:00
Scott Nonnenberg 6f2260d08c
v1.1.0-beta.5
Support pass-through proxies with HTTPS_PROXY env var (#1878)
2017-12-08 16:26:35 -08:00
Scott Nonnenberg b17a67ec65
Support pass-through proxies with HTTPS_PROXY env var (#1878)
We've simplified; HTTPS_PROXY or https_proxy is used for all requests.

We also require that only our self-signed certificates are used for
secure traffic. That rules out all SSL-terminating MITM proxies, since
we don't trust their root certificate.

Once we're sure that this system works for people, we'll improve config
on MacOS and Windows.
2017-12-08 10:38:01 -08:00
Scott Nonnenberg 4f487d208d
v1.1.0-beta.4
Reduce download size by ~125MB versus the previous beta build, about
~25MB over the previous production build (#1869)

Dev:
  - Update to v1.0.41 equivalence
  (5bc70c35e7)
  - This update to match production includes update fixes for OSX.
  Note: The transition v1.1.0-beta.3->v1.1.0-beta.4 will still have
  upgrade difficulties. When v1.1.0-beta.4 updates to the next release
  version, the behavior will be fixed.
2017-12-06 14:28:57 -08:00
Scott Nonnenberg 5bc70c35e7
Fix ASAR filter: takes ASAR size down by ~200MB (#1869)
I knew the emoji stuff was huge, just didn't realize that our filtering
for the ASAR was broken so none of our rules applied!
2017-12-06 12:44:16 -08:00
Scott Nonnenberg 74d80fb1db
v1.1.0-beta.3
Add proxy support based on environment variables (#1855)

Fix issue where window would not show new message alerts on some Linux
systesm - thanks @cornerman (#1820)

Add a tray icon to the application behind command-line argument -
thanks @m-pilia (#1676)

Emoji:
  - Fix issue where clicks in emoji panel wouldn't do anything (#1849)
  - Add support for Emoji 5 - thanks @liliakai (#1797)
  - Eliminate unused emoji images from production package (#1849)

Deployment:
  - aptly.sh: support for current and previous ubuntu versions (#1856)
  - deployment: update electron-publisher-s3 to match builder update
  (17f0bb42bc)

Dev:
  - Update development branch to include everything up to v1.0.40
  (f013eed9d1
  and 3ac29a4ba3)
  - Update readme.md to use signal.org URLs - thanks @scienmind (#1814)
2017-12-04 17:27:01 -08:00
Scott Nonnenberg acc94edd23
Add proxy support based on environment variables (#1855)
We pull proxy settings from environment variables:

- HTTPS_PROXY for sending, profile pulls, and attachment download/upload
- WSS_PROXY for connecting to the websocket for receiving messages
- ALL_PROXY to provide one server for both

More details on our proxy handling:

- https://github.com/Rob--W/proxy-from-env#environment-variables
- https://github.com/TooTallNate/node-proxy-agent

This is the natural way of things for Linux. My understanding is that
most proxies on MacOS are system-wide and transparent, so it's not so
urgent. But Windows will likely require further UI for configuration.
Will need to do some testing with Windows users.
2017-12-04 15:35:50 -08:00
Scott Nonnenberg 2430ee00d4
Emoji: Eliminate unused images, make sure panel clicks add emoji (#1849)
* Emoji: Ensure that all clicks work by using emoji data directly

* Eliminate a number of unused emoji images from final build

* Re-add the generic sheets directory, which we partially filter
2017-12-04 10:19:35 -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 17f0bb42bc
deployment: update electron-publisher-s3 to match builder update 2017-11-22 17:37:54 -08:00
Scott Nonnenberg ed44981aa4
v1.1.0-beta.2
Windows 7: Use an alternate mechanism for notifications (#1812)

Retry failed signed key rotation; start rotation when registered (#1772)

Dev:
  - Update to electron-builder 19.29.0; may allow windows shortcut to
    stay deleted on update (#1804)
  - aptly.sh: Instructions for pruning old packages from repo (#1771)
  - Update development branch to include everything up to v1.0.39
    0e328f3911
2017-11-22 16:49:35 -08:00
Scott Nonnenberg 16ad94148a
Introduce library for notifications on downlevel windows (#1812) 2017-11-22 13:50:52 -08:00
Scott Nonnenberg 16d94a8022
Update to electron-builder 19.29.0 for better shortcut behavior (#1804)
* Update to electron-builder 19.29.0 for better shortcut behavior

Fix #1744

To get this bugfix: https://github.com/electron-userland/electron-builder/pull/2085

* Update electron-updater as required by electron-builder
2017-11-21 14:50:51 -08:00
Scott Nonnenberg 475e9020ed
v1.1.0-beta.1
Fix missing application icon on some Linux distributions (#1735)

Update to electron 1.7.9 (#1736)

Dev:
  - Be resilient to thrown non-errors in import process (#1737)
  - Beta builds: A few updates required for successful release (#1739)
  - Use icon from /images for window creation instead of /build (#1738)
  - Update development branch to include everything up to v1.0.37 9e6d50b966
2017-11-08 19:33:26 -08:00
Scott Nonnenberg e07021837a
Beta builds: A few updates required for successful release (#1739) 2017-11-08 19:32:44 -08:00
Scott Nonnenberg 48ec4003dd
Use icon from /images for window creation (#1738) 2017-11-08 19:11:33 -08:00
Scott Nonnenberg 1fdaa00660
Add icon to the window manually on creation (#1735)
This supplements the work we already do to tell the OS about our icon.
2017-11-08 17:33:20 -08:00
Scott Nonnenberg f7140af9cb
Update to the latest 1.7.x electron (#1736) 2017-11-08 17:32:52 -08:00
Scott Nonnenberg 9e6d50b966
Merge branch 'master' into development
Bringing our development (beta) branch inline with all the more urgent
fixes which went directly into the master (production) branch.
2017-11-08 17:02:00 -08:00