2 files changed, 23 insertions, 2 deletions
diff --git a/synapse/federation/transaction_queue.py b/synapse/federation/transaction_queue.py
index 099ace28c1..c021add936 100644
--- a/synapse/federation/transaction_queue.py
+++ b/synapse/federation/transaction_queue.py
@@ -519,7 +519,7 @@ class TransactionQueue(object):
except FederationDeniedError as e:
logger.info(e)
except Exception as e:
- logger.warn(
+ logger.exception(
"TX [%s] Failed to send transaction: %s",
destination,
e,
@@ -575,6 +575,7 @@ class TransactionQueue(object):
success = True
logger.debug("TX [%s] _attempt_new_transaction", destination)
+ logger.debug("TX [%s] _attempt_new_transaction", destination)
txn_id = str(self._next_txn_id)
diff --git a/synapse/federation/units.py b/synapse/federation/units.py
index 025a79c022..d278475d9a 100644
--- a/synapse/federation/units.py
+++ b/synapse/federation/units.py
@@ -117,6 +117,26 @@ class Transaction(JsonEncodedObject):
"Require 'transaction_id' to construct a Transaction"
)
- kwargs["pdus"] = [p.get_pdu_json() for p in pdus]
+ kwargs["pdus"] = [
+ _mangle_pdu(p.get_pdu_json())
+ for p in pdus
+ ]
return Transaction(**kwargs)
+
+
+def _mangle_pdu(pdu_json):
+ pdu_json.pop("hashes", None)
+ pdu_json.pop("signatures", None)
+
+ pdu_json["auth_events"] = list(_strip_hashes(pdu_json["auth_events"]))
+ pdu_json["prev_events"] = list(_strip_hashes(pdu_json["prev_events"]))
+
+ return pdu_json
+
+
+def _strip_hashes(iterable):
+ return (
+ (e, {})
+ for e, hashes in iterable
+ )
|