Commit graph

32 commits

Author SHA1 Message Date
Scott Nonnenberg
6b11f67dc6
Move logging to disk via bunyan
- Logging is available in main process as well as renderer process, and
  entries all go to one set of rotating files. Log entries in the
  renderer process go to DevTools as well as the console. Entries from
  the main process only show up in the console.
- We save three days of logs, one day per file in %userData%/logs
- The 'debug' object store is deleted in a new database migration
- Timestamps and level included in the new log we generate for publish
  as well as the devtools
- The bunyan API is exposed via windows.log (providing the ability to
  log at different levels, and save objects instead of just text), so we
  can move our code to it over time.

FREEBIE
2017-09-25 15:00:34 -07:00
lilia
3a9f4f0df3
Flatten database migrations
We can compress or toss out most of these one-off data migrations since
everyone starts from scratch with electron.

// FREEBIE
2017-09-14 16:53:39 -07:00
Scott Nonnenberg
bd0050b6c6 Cache messages on receipt, remove from cache when processed
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
4a1dc46ab3 Fixes to get local verification and sync messages working
FREEBIE
2017-08-04 12:03:25 -07:00
lilia
b93042f12f Add verified status
// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
c6bfdec84d Remove blockingApproval
// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
9f4a657e8a Add database migration
// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
4c945acb76 Remove unused object store reference
// FREEBIE
2017-03-04 17:57:32 -08:00
lilia
58d2f71e09 Add migration to clean up old expiring messages
Expiring messages received before 0.31.0 may not have an expires_at time
populated. Loading these messages once will update their expires_at if
it wasn't already set. To avoid loading too many messages into memory,
add them individually, and remove them from the collection as soon as
they are added, allowing them to be garbage collected immediately.

// FREEBIE
2017-03-01 18:05:36 -08:00
lilia
e4b9c51f88 Rework expiring messages management
// FREEBIE
2017-02-22 16:18:01 -08:00
lilia
b888e01044 Add an index on message.expireTimer
This allows us to query all expiring messages on startup.
2016-09-28 17:20:02 -07:00
lilia
760bfffb50 Show all contacts all the time
Contacts without conversation identity appear in alphabetical order at
the end of the inbox.

// FREEBIE
2016-03-18 11:21:11 -07:00
lilia
1f897f32b7 Track and sync unread messages
// FREEBIE
2016-02-22 17:11:17 -08:00
lilia
b8602a3b42 Make migrations more robust
Occasionally these will fail if they happen to be executed before the
necessary dependencies (storage, ConversationCollection) are declared.

// FREEBIE
2016-02-12 17:18:37 -08:00
lilia
48626ceafb Remove spurious storage.fetch from migration
This should really only be called once, from background.js.

Calling it twice can cause doubled listeners for the registration_done
event, which in turn leads to duplicate post-registration callbacks,
dual sync requests, and an eventual datastore inconsistency.

Fixes #670

// FREEBIE
2016-02-12 17:02:11 -08:00
lilia
bf632bfa54 Fix migrations
Migrations should always call next() exactly once.

// FREEBIE
2016-02-03 17:56:23 -08:00
lilia
87ddcef333 Make debug log persistent
Save log entries in indexedDB rather than just in memory. Reload them
whenever the background page is refreshed.

// FREEBIE
2016-02-03 13:30:55 -08:00
lilia
34ae81c30d Redo previous migration
This time, wait for storage to be ready.

Fixes #608

// FREEBIE
2016-01-15 01:40:26 -08:00
lilia
6a268f0325 Migrate registration state
Follow up to 5223e6e for existing installations that never set this flag.

// FREEBIE
2016-01-14 10:38:46 -08:00
lilia
01593363eb Add migration to update search tokens
Previous commit changed the token schema slightly so now we need to run
a migration to update existing conversations.

// FREEBIE
2015-12-09 18:58:51 -08:00
lilia
ed32801c3e Reset unreadCounts
Add a migration to reset bad unreadCounts from previously broken
unreadCount tracking. This will execute exactly once per installation.

// FREEBIE
2015-11-19 17:27:24 -08:00
lilia
f70c22f898 Add search field to inbox
Using the search field produces a filtered view of all contacts and
groups containing the input. To make this fast and scalable, add an
index on a 'tokens' array containing words from the conversation name
and different forms of phone number.

Closes #365

// FREEBIE
2015-10-15 13:33:07 -07:00
lilia
f764445c86 Remove erroneous license file and headers
We only use GPLV3 around here.

// FREEBIE
2015-09-07 14:58:42 -07:00
lilia
2e272b6894 Turn off idb query logging
++speed
2015-07-16 12:13:45 -07:00
lilia
d230df5622 Move local identitykey and registrationid to indexeddb 2015-05-15 11:38:14 -07:00
lilia
d0e262d7cb AxolotlStore stores groups in indexeddb 2015-05-06 17:49:31 -07:00
lilia
c26c6fc317 Store sessions by encodedNumber
Storing multiple sessions in a single indexeddb record is prone to
clobbering data due to races between requests to update multiple device
sessions for the same number, since you have to read the current state
of the device->session map and update it. Splitting the records up makes
it so that those updates can be made in parallel. Selecting all the
sessions for a given number can still be done efficiently thanks to
indexeddb range queries.
2015-05-05 17:44:59 -07:00
lilia
7eda48f755 Move Session Storage to indexedDB 2015-05-05 17:44:58 -07:00
lilia
96eafc7750 Integrate libaxolotl async storage changes
* Session records are now opaque strings, so treat them that way:
  - no more cross checking identity key and session records
  - Move hasOpenSession to axolotl wrapper
  - Remote registration ids must be fetched async'ly via protocol wrapper
* Implement async AxolotlStore using textsecure.storage
* Add some db stores and move prekeys and signed keys to indexeddb
* Add storage tests
* Rename identityKey storage key from libaxolotl25519KeyidentityKey to
  simply identityKey, since it's no longer hardcoded in libaxolotl
* Rework registration and key-generation, keeping logic in libtextsecure
  and rendering in options.js.
* Remove key_worker since workers are handled at the libaxolotl level
  now
2015-05-05 17:44:55 -07:00
lilia
ed928aa4e3 Add index on conversation type
So we can load only groups or only contacts.

This changes the schema and requires you to delete your database to
re-run the migration.
2015-02-11 17:38:01 -08:00
lilia
006653ed8e DB/Index Redux
This change removes the timestamp field from messages and conversations
in favor of multiple semantically named timestamp fields: sent_at,
received_at on messages; active_at on conversations. This requires/lets
us rethink and improve our indexing scheme thusly:

The inbox index on conversations will order entries by the
conversation.active_at property, which should only appear on
conversations destined for the inbox.

The receipt index will use the message.sent_at property, for effecient
lookup of outgoing messages by timestamp, for use in processing delivery
receipts.

The group index on conversation.members is multi-entry, meaning that
looking up any phone number in this index will efficiently yield all
groups the number belongs to.

The conversation index lets us scan messages in a single conversation,
in the order they were received (or the reverse order). It is a compound
index on [conversationId, received_at].
2014-12-19 17:39:40 -08:00
lilia
ced295a630 Move message and conversation storage to IndexedDB
Getting up and running with IndexedDB was pretty easy, thanks to
backbone. The tricky part was making reads and writes asynchronous.
In that process I did some refactoring on Whisper.Threads, which
has been renamed Conversations for consistency with the view names.

This change also adds the unlimitedStorage permission.
2014-11-24 19:25:03 -08:00