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

Already on GitHub? Sign in to your account

Add count of one time keys to sync stream #2237

Merged
merged 5 commits into from May 23, 2017

Conversation

Projects
None yet
2 participants
Owner

erikjohnston commented May 19, 2017

This adds the following to a sync result:

{
    "device_one_time_keys_count": {
        "signed_curve25519": 50
    },
    ...
}

looks ok, but count_e2e_one_time_keys has a cache, and I'm unconvinced it will be correctly invalidated in the synchotrons when a key is claimed in the main process.

@richvdh richvdh assigned erikjohnston and unassigned richvdh May 22, 2017

Owner

erikjohnston commented May 22, 2017

looks ok, but count_e2e_one_time_keys has a cache, and I'm unconvinced it will be correctly invalidated in the synchotrons when a key is claimed in the main process.

Oops, yeah. It now streams the invalidations to workers.

@erikjohnston erikjohnston assigned richvdh and unassigned erikjohnston May 22, 2017

Owner

erikjohnston commented May 22, 2017

(The sqlite failure is spurious as it built on a box that didn't have tox installed)

you missed one of the calls:

self.count_e2e_one_time_keys.invalidate, (user_id, device_id,)

LGTM otherwise

@richvdh richvdh assigned erikjohnston and unassigned richvdh May 22, 2017

Owner

erikjohnston commented May 23, 2017

But i used grep and everything! :(

synapse/storage/end_to_end_keys.py
@@ -240,6 +240,9 @@ def _claim_e2e_one_time_keys(txn):
txn.call_after(
self.count_e2e_one_time_keys.invalidate, (user_id, device_id,)
@richvdh

richvdh May 23, 2017

Member

now redundant?

Member

richvdh commented May 23, 2017

But i used grep and everything! :(

Apparently you fail at grep.

@richvdh richvdh closed this May 23, 2017

@richvdh richvdh reopened this May 23, 2017

Owner

erikjohnston commented May 23, 2017

Apparently you fail at grep.

And editing code too. Sigh. applies more coffee

lgtm

@erikjohnston erikjohnston merged commit fbbc40f into develop May 23, 2017

6 of 8 checks passed

Sytest SQLite (Commit) Build #3104 origin/erikj/sync_key_count failed in 3.5 sec
Details
Sytest SQLite (Merged PR) Build finished.
Details
Sytest Dendron (Commit) Build #2200 origin/erikj/sync_key_count succeeded in 8 min 58 sec
Details
Sytest Dendron (Merged PR) Build finished.
Details
Sytest Postgres (Commit) Build #3035 origin/erikj/sync_key_count succeeded in 8 min 8 sec
Details
Sytest Postgres (Merged PR) Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

richvdh added a commit to matrix-org/matrix-js-sdk that referenced this pull request Jul 19, 2017

use device_one_time_keys_count transmitted by /sync (#493)
Where it is available, use the one_time_keys_count returned by /sync instead of polling the server for it.

This was added to synapse in matrix-org/synapse#2237.

@erikjohnston erikjohnston deleted the erikj/sync_key_count branch Oct 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment