diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-05-23 16:12:27 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-05-23 16:20:47 +0200 |
commit | 7bff4f2856a2cc8126fa8d2fecbd07e0422f2fb4 (patch) | |
tree | ff0ac2f5ee741ef566b4d017f2d882feca61aaee /wee_slack.py | |
parent | e03a131bd75bfc478ab9359000d860bd772cff10 (diff) | |
download | wee-slack-7bff4f2856a2cc8126fa8d2fecbd07e0422f2fb4.tar.gz |
Fix broken receive_httprequest_callback when record_events is true
When removing pickle in commit 3639342 I broke record_events without
realizing it. record_events tries to json serialize the response dict,
and that failed because that dict includes some metadata which without
pickle is a class instead of a string.
Fix it by recording the event before adding the metadata. I don't think
there is much point in recording the metadata, and the serialized output
from pickle wasn't practical anyways.
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index 93e15e4..a1e635f 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -477,10 +477,10 @@ class EventRouter(object): # dbg("Incomplete json, awaiting more", True) try: j["wee_slack_process_method"] = request_metadata.request_normalized - j["wee_slack_request_metadata"] = request_metadata - self.reply_buffer.pop(request_metadata.response_id) if self.recording: self.record_event(j, 'wee_slack_process_method', 'http') + j["wee_slack_request_metadata"] = request_metadata + self.reply_buffer.pop(request_metadata.response_id) self.receive(j) self.delete_context(data) except: |