You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-desktop/js
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 */]
```
8 years ago
..
models Fix quote thumbnail flickering issue 8 years ago
modules Index messages with attachments using a boolean 8 years ago
views Move `private` method below `public` ones 8 years ago
.eslintrc Auto-fixes: UX Improvements (#2077) 8 years ago
Mp3LameEncoder.min.js Copy audio-related files into js/ instead of symlinking them (#1456) 8 years ago
WebAudioRecorderMp3.js Copy audio-related files into js/ instead of symlinking them (#1456) 8 years ago
background.js Apply iOS theme after link 8 years ago
chromium.js
conversation_controller.js Use single quotes for identifiers 8 years ago
database.js Conditionally run post-attachment migrations 8 years ago
delivery_receipts.js Immediately remove delivery receipts from the retry cache (#1719) 8 years ago
emoji_util.js Upgrade emoji support (#1482) 8 years ago
expire.js
expiring_messages.js
focus_listener.js Ensure `isFocused` always returns boolean 8 years ago
jquery.js Set parent window for about/new version, escape to close (#1795) 8 years ago
keychange_listener.js
libphonenumber-util.js
libsignal-protocol-worker.js
logging.js Remove unused `require` 8 years ago
notifications.js Simplify log statement 8 years ago
read_receipts.js Feature: Blue check marks for read messages if opted in (#1489) 8 years ago
read_syncs.js Feature: Blue check marks for read messages if opted in (#1489) 8 years ago
registration.js Remove config after unlink, clear db when linked with new number 8 years ago
reliable_trigger.js
rotate_signed_prekey_listener.js Prefer ISO date formatting 8 years ago
signal_protocol_store.js Refactor: db tasks to database.js, log delete to modules/logs.js 8 years ago
spell_check.js Merge locale-provided strings into english for failover support 8 years ago
storage.js Improve `storage.fetch` error message 8 years ago
wall_clock_listener.js Reschedule all timers on time travel, set interval back to 1000ms 8 years ago