Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #954 from matrix-org/markjh/even_more_fixes
Browse files Browse the repository at this point in the history
Fix a couple of bugs in the transaction and keyring code
  • Loading branch information
NegativeMjark authored Jul 27, 2016
2 parents c63b169 + 87ffd21 commit 09d3181
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
17 changes: 9 additions & 8 deletions synapse/crypto/keyring.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,15 @@ def do_iterations():
for server_name, groups in missing_groups.items()
}

for group in missing_groups.values():
group_id_to_deferred[group.group_id].errback(SynapseError(
401,
"No key for %s with id %s" % (
group.server_name, group.key_ids,
),
Codes.UNAUTHORIZED,
))
for groups in missing_groups.values():
for group in groups:
group_id_to_deferred[group.group_id].errback(SynapseError(
401,
"No key for %s with id %s" % (
group.server_name, group.key_ids,
),
Codes.UNAUTHORIZED,
))

def on_err(err):
for deferred in group_id_to_deferred.values():
Expand Down
3 changes: 2 additions & 1 deletion synapse/storage/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import itertools
import logging
import ujson as json

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -101,7 +102,7 @@ def _get_received_txn_response(self, txn, transaction_id, origin):
)

if result and result["response_code"]:
return result["response_code"], result["response_json"]
return result["response_code"], json.loads(str(result["response_json"]))
else:
return None

Expand Down

0 comments on commit 09d3181

Please sign in to comment.