Skip to content

Commit 6d062a8

Browse files
authored
Merge pull request #11 from jagerman/session-workaround
Session stale token workaround
2 parents bf7974f + 4abc1fa commit 6d062a8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

sogs/legacy_routes.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,15 @@ def handle_comapct_poll():
214214
try:
215215
r = handle_one_compact_poll(req)
216216
except HTTPException as e:
217-
r = {'status_code': e.get_response().status_code, 'results': []}
217+
# Hack for Session: if there isn't a full fleshed out response then Session just ignores
218+
# the response (even when it's an error response), so we send this fake response:
219+
r = {
220+
'status_code': e.get_response().status_code,
221+
'room_id': req.get('room_id', ''),
222+
'messages': [],
223+
'deletions': [],
224+
'moderators': [],
225+
}
218226
result.append(r)
219227

220228
return jsonify({'status_code': 200, 'results': result})

0 commit comments

Comments
 (0)