Commit Graph

31 Commits (f7581cf4ebee13edb51e6372e9903c5e8745d0e9)

Author SHA1 Message Date
Audric Ackermann f7581cf4eb
increase prettier maxWidth to 100 3 years ago
Audric Ackermann 02fb5783a4
remove regionCode and PhoneNumber.ts 3 years ago
Scott Nonnenberg 1d2c3ae23c Download attachments in separate queue from message processing 5 years ago
Scott Nonnenberg 813924685e Link Previews 5 years ago
Scott Nonnenberg 5933a34a18 Use window.log in browser context, turn on console eslint rule 6 years ago
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
6 years ago
Scott Nonnenberg aa13a2c6f7 Parse phone numbers into e164 as part of schema upgrade 6 years ago
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.
6 years ago
Scott Nonnenberg 420f81ebcd Move contact migrate code from message.js to contact.js 6 years ago
Scott Nonnenberg 3ea3e4e256 Contact sharing: protos and data pipeline
As of this commit: 82b76ccf37
6 years ago
Daniel Gasienica 1dd87ad197 Format all source code using Prettier 6 years ago
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.
6 years ago
Daniel Gasienica 8b9516de72 Update test for attachment metadata 6 years ago
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 */]
```
6 years ago
Daniel Gasienica 867bece952 Add `Message.initializeAttachmentMetadata` 6 years ago
Scott Nonnenberg bf81c3db63
Document Message v4, remove data-free thumbnails 6 years ago
Scott Nonnenberg a7d44d3344
Backup and end-to-end test! 6 years ago
Scott Nonnenberg 9ad55c803f
Fix handling attachment thumbnails using thumbnail key 6 years ago
Scott Nonnenberg fce9bb7342
Move to central MIME functions, remove some console.log
And generally address PR feedback.
6 years ago
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
6 years ago
Daniel Gasienica 24f4ad53bc Use single quotes for identifiers 6 years ago
Daniel Gasienica 4c4443390a Rename `createImporter` to `createAttachmentDataWriter` 6 years ago
Daniel Gasienica bf67254cc5 Add `Message.createImporter` 6 years ago
Daniel Gasienica efd673083d Rename `writeAttachmentData` to `writeNewAttachmentData` 6 years ago
Daniel Gasienica 867f73b80a Use double quotes for identifiers in error messages 6 years ago
Daniel Gasienica 06e7bca276 Use new `stringToArrayBuffer` function 6 years ago
Daniel Gasienica 2cd3d5ac16 Add `Message` schema version 3 6 years ago
Daniel Gasienica 8dfaa5619f Prefix private functions with underscore 6 years ago
Daniel Gasienica ed336d31d7 Move schema versioning from `Attachment` to `Message` 6 years ago
Daniel Gasienica b9e9f5e19a 🎨 `withInheritedSchemaVersion` to `inheritSchemaVersion` 6 years ago
Daniel Gasienica c27746b79e Add `Message.withInheritedSchemaVersion` 6 years ago