New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate room encryption store to crypto store #597

Merged
merged 19 commits into from Feb 6, 2018

Conversation

Projects
None yet
2 participants
@dbkr
Copy link
Member

dbkr commented Jan 22, 2018

Final cryptostore migration PR!

Based on #594 so probably want to get that merge before trying to review.

@dbkr dbkr assigned dbkr and unassigned richvdh Jan 22, 2018

Implement correct function
in localstorage and memory stores

@dbkr dbkr assigned richvdh and unassigned dbkr Jan 22, 2018

@@ -54,6 +54,7 @@
"bluebird": "^3.5.0",
"browser-request": "^0.3.3",
"content-type": "^1.0.2",
"olm": "https://matrix.org/packages/npm/olm/olm-2.2.2.tgz",

This comment has been minimized.

@richvdh

richvdh Jan 29, 2018

Member

olm was deliberately omitted here for some reason involving making it possible to do without it. the details currently escape me, but what is the reason for adding it?

This comment has been minimized.

@dbkr

dbkr Jan 31, 2018

Member

bah, because npm now adds any package you install to package.json even if you don't specify --save.

@@ -181,6 +182,11 @@ function MatrixClient(opts) {
if (CRYPTO_ENABLED) {
this.olmVersion = Crypto.getOlmVersion();
}

// List of what rooms have encryption enabled: separate from crypto because

This comment has been minimized.

@richvdh

richvdh Jan 29, 2018

Member

which rooms

This comment has been minimized.

@dbkr

dbkr Jan 31, 2018

Member

fixed :)

@@ -181,6 +182,11 @@ function MatrixClient(opts) {
if (CRYPTO_ENABLED) {
this.olmVersion = Crypto.getOlmVersion();
}

// List of what rooms have encryption enabled: separate from crypto because
// we still want to know what rooms are encrypted even if crypto is disabled:

This comment has been minimized.

@richvdh

richvdh Jan 29, 2018

Member

which

This comment has been minimized.

@dbkr

dbkr Jan 31, 2018

Member

also fixed


// List of what rooms have encryption enabled: separate from crypto because
// we still want to know what rooms are encrypted even if crypto is disabled:
// we don't want to start sening unencrypted events to them.

This comment has been minimized.

@richvdh

richvdh Jan 29, 2018

Member

sening

This comment has been minimized.

@dbkr

dbkr Jan 31, 2018

Member

also done

this._cryptoStore = cryptoStore;
this._sessionStore = sessionStore;

// Object of roomId -> room e2e info object

This comment has been minimized.

@richvdh

richvdh Jan 29, 2018

Member

could we document the shape of said object hereabouts?

This comment has been minimized.

@dbkr

dbkr Jan 31, 2018

Member

have added that it's the body of the m.room.encryption object

"a change of config in " + roomId);
return;
}
const existingConfig = await this.getRoomEncryption(roomId);

This comment has been minimized.

@richvdh

richvdh Jan 29, 2018

Member

given this seems to be the only place getRoomEncryption is used, any reason not to inline it?

This comment has been minimized.

@dbkr

dbkr Jan 31, 2018

Member

mm, point

*
* @param {string} roomId The room ID to query
*
* @return {object} The current end-to-end encyption status, or null if

This comment has been minimized.

@richvdh

richvdh Jan 29, 2018

Member

I don't really understand why you've made this async, but given you have, the return type is a promise

This comment has been minimized.

@dbkr

dbkr Jan 31, 2018

Member

ah ok. I think the reason it's async was to match the rest of the crypto stuff which assumes it's going to be indexeddb backed. I'd also assumed that the Promise return type was implicit on an async function.

@richvdh richvdh assigned dbkr and unassigned richvdh Jan 29, 2018

@dbkr dbkr assigned richvdh and unassigned dbkr Jan 31, 2018

@richvdh

richvdh approved these changes Feb 5, 2018

Copy link
Member

richvdh left a comment

lgtm

@richvdh richvdh assigned dbkr and unassigned richvdh Feb 5, 2018

@dbkr dbkr merged commit 47dfb4b into develop Feb 6, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

krombel added a commit to krombel/matrix-js-sdk that referenced this pull request Mar 21, 2018

Merge tag 'v0.10.0-rc.1' into krombel_websockets
[Full Changelog](matrix-org/matrix-js-sdk@v0.9.2...v0.10.0-rc.1)
* Fix duplicated state events in timeline from peek
[\matrix-org#630](matrix-org#630)
* Create indexeddb worker when starting the store
[\matrix-org#627](matrix-org#627)
* Fix indexeddb logging
[\matrix-org#626](matrix-org#626)
* Don't do /keys/changes on incremental sync
[\matrix-org#625](matrix-org#625)
* Don't mark devicelist dirty unnecessarily
[\matrix-org#623](matrix-org#623)
* Cache the joined member count for a room state
[\matrix-org#619](matrix-org#619)
* Fix JS doc
[\matrix-org#618](matrix-org#618)
* Precompute push actions for state events
[\matrix-org#617](matrix-org#617)
* Fix bug where global "Never send to unverified..." is ignored
[\matrix-org#616](matrix-org#616)
* Intern legacy top-level 'membership' field
[\matrix-org#615](matrix-org#615)
* Don't synthesize RR for m.room.redaction as causes the RR to go missing.
[\matrix-org#598](matrix-org#598)
* Make Events create Dates on demand
[\matrix-org#613](matrix-org#613)
* Stop cloning events when adding to state
[\matrix-org#612](matrix-org#612)
* De-dup code: use the initialiseState function
[\matrix-org#611](matrix-org#611)
* Create sentinel members on-demand
[\matrix-org#610](matrix-org#610)
* Some more doc on how sentinels work
[\matrix-org#609](matrix-org#609)
* Migrate room encryption store to crypto store
[\matrix-org#597](matrix-org#597)
* add parameter to getIdentityServerUrl to strip the protocol for invites
[\matrix-org#600](matrix-org#600)
* Move Device Tracking Data to Crypto Store
[\matrix-org#594](matrix-org#594)
* Optimise pushprocessor
[\matrix-org#591](matrix-org#591)
* Set event error before emitting
[\matrix-org#592](matrix-org#592)
* Add event type for stickers [WIP]
[\matrix-org#590](matrix-org#590)
* Migrate inbound sessions to cryptostore
[\matrix-org#587](matrix-org#587)
* Disambiguate names if they contain an mxid
[\matrix-org#588](matrix-org#588)
* Check for sessions in indexeddb before migrating
[\matrix-org#585](matrix-org#585)
* Emit an event for crypto store migration
[\matrix-org#586](matrix-org#586)
* Supporting fixes For making UnknownDeviceDialog not pop up automatically
[\matrix-org#575](matrix-org#575)
* Move sessions to the crypto store
[\matrix-org#584](matrix-org#584)
* Change crypto store transaction API
[\matrix-org#582](matrix-org#582)
* Add some missed copyright notices
[\matrix-org#581](matrix-org#581)
* Move Olm account to IndexedDB
[\matrix-org#579](matrix-org#579)
* Fix logging of DecryptionErrors to be more useful
[\matrix-org#580](matrix-org#580)
* [BREAKING] Change the behaviour of the unverfied devices blacklist flag
[\matrix-org#568](matrix-org#568)
* Support set_presence=offline for syncing
[\matrix-org#557](matrix-org#557)
* Consider cases where the sender may not redact their own event
[\matrix-org#556](matrix-org#556)

krombel added a commit to krombel/matrix-js-sdk that referenced this pull request Apr 18, 2018

Merge tag 'v0.10.0-rc.1' into krombel_websockets
[Full Changelog](matrix-org/matrix-js-sdk@v0.9.2...v0.10.0-rc.1)
* Fix duplicated state events in timeline from peek
[\matrix-org#630](matrix-org#630)
* Create indexeddb worker when starting the store
[\matrix-org#627](matrix-org#627)
* Fix indexeddb logging
[\matrix-org#626](matrix-org#626)
* Don't do /keys/changes on incremental sync
[\matrix-org#625](matrix-org#625)
* Don't mark devicelist dirty unnecessarily
[\matrix-org#623](matrix-org#623)
* Cache the joined member count for a room state
[\matrix-org#619](matrix-org#619)
* Fix JS doc
[\matrix-org#618](matrix-org#618)
* Precompute push actions for state events
[\matrix-org#617](matrix-org#617)
* Fix bug where global "Never send to unverified..." is ignored
[\matrix-org#616](matrix-org#616)
* Intern legacy top-level 'membership' field
[\matrix-org#615](matrix-org#615)
* Don't synthesize RR for m.room.redaction as causes the RR to go missing.
[\matrix-org#598](matrix-org#598)
* Make Events create Dates on demand
[\matrix-org#613](matrix-org#613)
* Stop cloning events when adding to state
[\matrix-org#612](matrix-org#612)
* De-dup code: use the initialiseState function
[\matrix-org#611](matrix-org#611)
* Create sentinel members on-demand
[\matrix-org#610](matrix-org#610)
* Some more doc on how sentinels work
[\matrix-org#609](matrix-org#609)
* Migrate room encryption store to crypto store
[\matrix-org#597](matrix-org#597)
* add parameter to getIdentityServerUrl to strip the protocol for invites
[\matrix-org#600](matrix-org#600)
* Move Device Tracking Data to Crypto Store
[\matrix-org#594](matrix-org#594)
* Optimise pushprocessor
[\matrix-org#591](matrix-org#591)
* Set event error before emitting
[\matrix-org#592](matrix-org#592)
* Add event type for stickers [WIP]
[\matrix-org#590](matrix-org#590)
* Migrate inbound sessions to cryptostore
[\matrix-org#587](matrix-org#587)
* Disambiguate names if they contain an mxid
[\matrix-org#588](matrix-org#588)
* Check for sessions in indexeddb before migrating
[\matrix-org#585](matrix-org#585)
* Emit an event for crypto store migration
[\matrix-org#586](matrix-org#586)
* Supporting fixes For making UnknownDeviceDialog not pop up automatically
[\matrix-org#575](matrix-org#575)
* Move sessions to the crypto store
[\matrix-org#584](matrix-org#584)
* Change crypto store transaction API
[\matrix-org#582](matrix-org#582)
* Add some missed copyright notices
[\matrix-org#581](matrix-org#581)
* Move Olm account to IndexedDB
[\matrix-org#579](matrix-org#579)
* Fix logging of DecryptionErrors to be more useful
[\matrix-org#580](matrix-org#580)
* [BREAKING] Change the behaviour of the unverfied devices blacklist flag
[\matrix-org#568](matrix-org#568)
* Support set_presence=offline for syncing
[\matrix-org#557](matrix-org#557)
* Consider cases where the sender may not redact their own event
[\matrix-org#556](matrix-org#556)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment