Commit graph

342 commits

Author SHA1 Message Date
Scott Nonnenberg
aa13a2c6f7 Parse phone numbers into e164 as part of schema upgrade 2018-05-10 11:54:58 -07:00
Daniel Gasienica
16bc1d34c6 Message schema 6: Change classification of media and documents
For an easier implementation, we change our original definition of
`initializeAttachmentMetadata`. This means we have to re-run it marked as
version 6 and mark schema version 5 as deprecated as its definition has changed.
2018-05-08 16:41:07 -04:00
Scott Nonnenberg
26be658892 Remove 'Contact' from 'Contact.*' properties, clean->parse 2018-05-08 13:12:11 -07:00
Scott Nonnenberg
adbe989949 validateContact: Return error instead of logging 2018-05-08 10:31:16 -07:00
Scott Nonnenberg
420f81ebcd Move contact migrate code from message.js to contact.js 2018-05-08 09:48:47 -07:00
Scott Nonnenberg
41be7f126b Visuals for embedded contacts as well as contact detail screen 2018-05-07 19:09:55 -07:00
Scott Nonnenberg
3ea3e4e256 Contact sharing: protos and data pipeline
As of this commit: 82b76ccf37
2018-05-07 19:09:55 -07:00
Daniel Gasienica
5c8f734e67 Remove newlines from group IDs 2018-05-03 13:24:39 -04:00
Daniel Gasienica
a102016ed8 Port Settings and OS to TypeScript 2018-05-02 20:01:57 -04:00
Daniel Gasienica
95321e5d3e Remove Vim mode lines 2018-04-30 16:53:34 -04:00
Daniel Gasienica
1dd87ad197 Format all source code using Prettier 2018-04-30 16:53:34 -04:00
Daniel Gasienica
41fe50553f Replace Backbone saveFile with Attachment.save 2018-04-27 16:31:42 -04:00
Daniel Gasienica
9a76d4bcf8 Whitelist assert global for tests 2018-04-27 16:31:42 -04:00
Daniel Gasienica
19411a78c8 Remove dead code 2018-04-25 15:25:12 -04:00
Daniel Gasienica
52e4e5aece Omit undefined keys when comparing IndexedDB data 2018-04-25 15:25:12 -04:00
Daniel Gasienica
f36f206a01 Use IndexablePresence for hasFileAttachments and hasVisualMediaAttachments
Reduces index size, makes it easier to debug using IndexedDB inspector, and
hopefully improves lookup performance.
2018-04-25 15:25:12 -04:00
Daniel Gasienica
3a33d862c0 Update backup test fixture 2018-04-25 15:25:12 -04:00
Daniel Gasienica
8b9516de72 Update test for attachment metadata 2018-04-25 15:24:52 -04:00
Daniel Gasienica
b0e1cc49a5 Remove legacy Backbone lightbox 2018-04-25 15:24:51 -04:00
Daniel Gasienica
9d84b2f420 Index messages with attachments using a boolean
When indexing message attachment metadata using numeric indexes such as:

```javascript
{
  conversationId: '+12223334455',
  received_at: 123,
  attachments: […],
  numAttachments: 2,
},
{
  conversationId: '+12223334455',
  received_at: 456,
  attachments: [],
  numAttachments: 0,
}
{
  conversationId: '+12223334455',
  received_at: 789,
  attachments: [],
  numAttachments: 1,
}
```

It creates an index as follows:

```
[conversationId, received_at, numAttachments]
['+12223334455', 123, 2]
['+12223334455', 456, 0]
['+12223334455', 789, 1]
```

This means a query such as…

```
lowerBound: ['+12223334455', 0,                1               ]
upperBound: ['+12223334455', Number.MAX_VALUE, Number.MAX_VALUE]
```

…will return all three original entries because they span the `received_at`
from `0` through `Number.MAX_VALUE`. One workaround is to index booleans using
`1 | undefined` where `1` is included in the index and `undefined` is not, but
that way we lose the ability to query for the `false` value. Instead, we flip
adjust the index to `[conversationId, hasAttachments, received_at]` and can
then query messages with attachments using

```
[conversationId, 1 /* hasAttachments */, 0                /* received_at */]
[conversationId, 1 /* hasAttachments */, Number.MAX_VALUE /* received_at */]
```
2018-04-25 15:24:51 -04:00
Daniel Gasienica
f9e4613395 Move TS test for message migration 2018-04-25 15:24:50 -04:00
Daniel Gasienica
867bece952 Add Message.initializeAttachmentMetadata 2018-04-25 15:24:50 -04:00
Daniel Gasienica
df2e6e7864 Port MIME module to TypeScript 2018-04-25 15:24:50 -04:00
Scott Nonnenberg
bf81c3db63
Document Message v4, remove data-free thumbnails 2018-04-23 16:43:25 -07:00
Scott Nonnenberg
c02860af5c
Responding to pull request review feedback
- messages.getQuoteObjectUrl: early return
- backup.js: explaining variables for long if statement
- types/messages.js: Log if thumbnail has neither data nor path
- sendmessage.js:
  - remove extraneous logging
  - fix indentation
  - upload attachments and thumbnails in parallel
- preload: don't load fs for tests, just fse
- _conversation.scss: split two selectors into two lines, 0px -> 0
- backup_test.js: use fse.existsSync and comment twoSlashes regex
- network_tests_view_test.js: Comment duplicate assignment to window.getSocketStatus
2018-04-23 15:36:47 -07:00
Scott Nonnenberg
6ec6bf08c8
Backup E2E test: Normalize paths because glob returns / on WIN 2018-04-20 17:29:55 -07:00
Scott Nonnenberg
1bfc1ed63e
Backup E2E test: Fix path analysis on windows 2018-04-20 16:56:39 -07:00
Scott Nonnenberg
a7d44d3344
Backup and end-to-end test! 2018-04-20 15:24:04 -07:00
Scott Nonnenberg
c3acf43c47
Eslintify test/backup_test.js 2018-04-20 15:24:04 -07:00
Scott Nonnenberg
3abaeb807d
Prevent infinite repeated errors on leaving electron tests open 2018-04-20 15:24:03 -07:00
Scott Nonnenberg
334fe32210
Fix electron test race condition with protobuf loading 2018-04-20 15:24:02 -07:00
Scott Nonnenberg
12257e1560
MessageView: Show menu w/ 'reply to message' on triple-dot click 2018-04-20 15:23:55 -07:00
Scott Nonnenberg
26e4e97592
Tighten up CSS
- Remove extra padding at top of Android bubbles, via sibling selector
- Don't include .attachments, .quote-wrapper, .content in bubble unless
  we actually need them. This allows for sibling selectors.
- This is a different technique for adding the ReactWrapperView for
  quotes - it is now appended to the DOM instead of attaching to
  something already in the DOM. This allows us to use .remove(), so it's
  a bit cleaner.
- Users of ReactWrapperView can now specify tagName and className
2018-04-20 15:23:47 -07:00
Scott Nonnenberg
30957341e4
Show three dot icon next to message on hover
But only if it doesn't have an error.

Also: reformatted message template in legacy_templates.js to match what
is in background.html for easier diffing.
2018-04-20 15:23:47 -07:00
Scott Nonnenberg
a563dc8b37
Style Guide: Additional message examples, a few fixes to enable 2018-04-20 15:23:47 -07:00
Scott Nonnenberg
3bbbf65a6b
Fix iOS: tail, blue partial border, extra attachment space
Turns out that display: inline on the img tag resulted in a mysterious
3px of space added below it.
2018-04-13 18:10:52 -07:00
Scott Nonnenberg
9ad55c803f
Fix handling attachment thumbnails using thumbnail key 2018-04-13 18:10:51 -07:00
Scott Nonnenberg
fce9bb7342
Move to central MIME functions, remove some console.log
And generally address PR feedback.
2018-04-13 18:10:51 -07:00
Scott Nonnenberg
92a89a8e41
Fix MessageView test: p -> div 2018-04-13 18:10:48 -07:00
Scott Nonnenberg
2243e348f1
Wire up fake window.Signal.HTML because it's captured on load 2018-04-13 18:10:48 -07:00
Scott Nonnenberg
054d3887a1
Quotes: The full pipeline into the database
1. MessageReceiver always pulls down thumbnails included in quotes
2. Message.upgradeSchema has a new schema that puts all thumbnails on
   disk just like happens with full attachments.
3. handleDataMessage pipes quote from dataMessage into the final message
   destined for the database
2018-04-13 18:05:45 -07:00
Scott Nonnenberg
e69586200a
Unleash eslint on message_receiver.js - lots of change 2018-04-13 18:05:45 -07:00
Scott Nonnenberg
21bf02c94d
Fixed examples in Quote.md, rough Android visuals 2018-04-13 18:05:44 -07:00
Scott Nonnenberg
ae043bf239
In iOS theme, join attachment bubble with caption bubble 2018-04-13 18:05:42 -07:00
Scott Nonnenberg
3a76c3c86e
Styleguide: Incoming/outgoing attachments of all types 2018-04-13 18:05:42 -07:00
Daniel Gasienica
ad05efb7a0 Expose Signal.Types.Conversation 2018-04-11 19:34:21 -04:00
Daniel Gasienica
96c07c6373 Bump timeout of debuglogs test 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
24f4ad53bc Use single quotes for identifiers 2018-04-11 15:54:32 -04:00
Daniel Gasienica
432a6ebd7f Redact file paths with escaped slashes 2018-04-11 15:30:59 -04:00