mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 15:25:03 -04:00
Consistently use db_to_json
to convert from database values to JSON objects. (#7849)
This commit is contained in:
parent
b0f031f92a
commit
f460da6031
22 changed files with 80 additions and 82 deletions
|
@ -21,7 +21,7 @@ from canonicaljson import json
|
|||
from twisted.internet import defer
|
||||
|
||||
from synapse.logging.opentracing import log_kv, set_tag, trace
|
||||
from synapse.storage._base import SQLBaseStore, make_in_list_sql_clause
|
||||
from synapse.storage._base import SQLBaseStore, db_to_json, make_in_list_sql_clause
|
||||
from synapse.storage.database import Database
|
||||
from synapse.util.caches.expiringcache import ExpiringCache
|
||||
|
||||
|
@ -65,7 +65,7 @@ class DeviceInboxWorkerStore(SQLBaseStore):
|
|||
messages = []
|
||||
for row in txn:
|
||||
stream_pos = row[0]
|
||||
messages.append(json.loads(row[1]))
|
||||
messages.append(db_to_json(row[1]))
|
||||
if len(messages) < limit:
|
||||
stream_pos = current_stream_id
|
||||
return messages, stream_pos
|
||||
|
@ -173,7 +173,7 @@ class DeviceInboxWorkerStore(SQLBaseStore):
|
|||
messages = []
|
||||
for row in txn:
|
||||
stream_pos = row[0]
|
||||
messages.append(json.loads(row[1]))
|
||||
messages.append(db_to_json(row[1]))
|
||||
if len(messages) < limit:
|
||||
log_kv({"message": "Set stream position to current position"})
|
||||
stream_pos = current_stream_id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue