Commit Graph

59 Commits (f1dbafc7ef97a6af365751337ac6fcd025478956)

Author SHA1 Message Date
Beaudan d8a410cc69 Linting of the test flies 6 years ago
Mikunj f589fdac5c Merge signal changes into branch. 7 years ago
Scott Nonnenberg ca61c9cb85 Warnings for dangerous files 7 years ago
Scott Nonnenberg 5933a34a18 Use window.log in browser context, turn on console eslint rule 7 years ago
Scott Nonnenberg b159a8d7c7 Update the user agent for debug log requests 7 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
7 years ago
Scott Nonnenberg aa13a2c6f7 Parse phone numbers into e164 as part of schema upgrade 7 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.
7 years ago
Scott Nonnenberg 26be658892 Remove 'Contact' from 'Contact.*' properties, clean->parse 7 years ago
Scott Nonnenberg adbe989949 validateContact: Return error instead of logging 7 years ago
Scott Nonnenberg 420f81ebcd Move contact migrate code from message.js to contact.js 7 years ago
Scott Nonnenberg 3ea3e4e256 Contact sharing: protos and data pipeline
As of this commit: 82b76ccf37
7 years ago
Daniel Gasienica 5c8f734e67 Remove newlines from group IDs 7 years ago
Daniel Gasienica a102016ed8 Port `Settings` and `OS` to TypeScript 7 years ago
Daniel Gasienica 1dd87ad197 Format all source code using Prettier 7 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.
7 years ago
Daniel Gasienica 8b9516de72 Update test for attachment metadata 7 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 */]
```
7 years ago
Daniel Gasienica f9e4613395 Move TS test for message migration 7 years ago
Daniel Gasienica 867bece952 Add `Message.initializeAttachmentMetadata` 7 years ago
Daniel Gasienica df2e6e7864 Port `MIME` module to TypeScript 7 years ago
Scott Nonnenberg bf81c3db63
Document Message v4, remove data-free thumbnails 7 years ago
Scott Nonnenberg a7d44d3344
Backup and end-to-end test! 7 years ago
Scott Nonnenberg c3acf43c47
Eslintify test/backup_test.js 7 years ago
Scott Nonnenberg 9ad55c803f
Fix handling attachment thumbnails using thumbnail key 7 years ago
Scott Nonnenberg fce9bb7342
Move to central MIME functions, remove some console.log
And generally address PR feedback.
7 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
7 years ago
Daniel Gasienica 96c07c6373 Bump timeout of `debuglogs` test 7 years ago
Daniel Gasienica 24f4ad53bc Use single quotes for identifiers 7 years ago
Daniel Gasienica 432a6ebd7f Redact file paths with escaped slashes 7 years ago
Daniel Gasienica d41e3cd6fc Add test for regular `_redactPath` 7 years ago
Daniel Gasienica a8a7525609 Redact stack traces with forward and backslashes 7 years ago
Daniel Gasienica b0da7d965e Redact URL encoded file paths in stack traces 7 years ago
Daniel Gasienica 2ee78ec556 Prefer `path` over `Path` 7 years ago
Daniel Gasienica 4c4443390a Rename `createImporter` to `createAttachmentDataWriter` 7 years ago
Daniel Gasienica bf67254cc5 Add `Message.createImporter` 7 years ago
Daniel Gasienica efd673083d Rename `writeAttachmentData` to `writeNewAttachmentData` 7 years ago
Daniel Gasienica ce8fe0d345 Add `Signal.Startup` module 7 years ago
Daniel Gasienica 867f73b80a Use double quotes for identifiers in error messages 7 years ago
Daniel Gasienica 06e7bca276 Use new `stringToArrayBuffer` function 7 years ago
Daniel Gasienica 2cd3d5ac16 Add `Message` schema version 3 7 years ago
Daniel Gasienica ebe2a769c9 Add `Attachment.migrateDataToFileSystem` 7 years ago
Daniel Gasienica 8dfaa5619f Prefix private functions with underscore 7 years ago
Daniel Gasienica ed336d31d7 Move schema versioning from `Attachment` to `Message` 7 years ago
Daniel Gasienica b9e9f5e19a 🎨 `withInheritedSchemaVersion` to `inheritSchemaVersion` 7 years ago
Daniel Gasienica c27746b79e Add `Message.withInheritedSchemaVersion` 7 years ago
Daniel Gasienica e9e46464c2 Add `SchemaVersion` type 7 years ago
Daniel Gasienica add4b11df3 Skip invalid attachments and make function sync 7 years ago
Daniel Gasienica 3dfc823716 Add `Attachment.removeSchemaVersion` 7 years ago
Daniel Gasienica 43b47fd349 Avoid `ensure-error` for privacy reasons
Example:

```
> node
> const nonError = {foo: 'i-am-private'};
undefined

// before
> util.inspect(nonError);
'{ foo: \'i-am-private\' }'

// after
> nonError.toString()
'[object Object]'
>
```
7 years ago