mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-02 05:26:02 -04:00
Merge remote-tracking branch 'origin/develop' into erikj/destination_retry_cache
This commit is contained in:
commit
a1cd37390f
51 changed files with 128 additions and 62 deletions
|
@ -27,4 +27,4 @@ try:
|
|||
except ImportError:
|
||||
pass
|
||||
|
||||
__version__ = "0.33.4"
|
||||
__version__ = "0.33.5.1"
|
||||
|
|
|
@ -713,10 +713,6 @@ class SyncHandler(object):
|
|||
)
|
||||
]
|
||||
|
||||
# always make sure we LL ourselves so we know we're in the room
|
||||
# (if we are), to fix https://github.com/vector-im/riot-web/issues/7209
|
||||
types.append((EventTypes.Member, sync_config.user.to_string()))
|
||||
|
||||
# only apply the filtering to room members
|
||||
filtered_types = [EventTypes.Member]
|
||||
|
||||
|
@ -726,6 +722,13 @@ class SyncHandler(object):
|
|||
}
|
||||
|
||||
if full_state:
|
||||
if lazy_load_members:
|
||||
# always make sure we LL ourselves so we know we're in the room
|
||||
# (if we are) to fix https://github.com/vector-im/riot-web/issues/7209
|
||||
# We only need apply this on full state syncs given we disabled
|
||||
# LL for incr syncs in #3840.
|
||||
types.append((EventTypes.Member, sync_config.user.to_string()))
|
||||
|
||||
if batch:
|
||||
current_state_ids = yield self.store.get_state_ids_for_event(
|
||||
batch.events[-1].event_id, types=types,
|
||||
|
@ -794,7 +797,7 @@ class SyncHandler(object):
|
|||
else:
|
||||
state_ids = {}
|
||||
if lazy_load_members:
|
||||
if types:
|
||||
if types and batch.events:
|
||||
# We're returning an incremental sync, with no
|
||||
# "gap" since the previous sync, so normally there would be
|
||||
# no state to return.
|
||||
|
|
|
@ -84,10 +84,21 @@ def wrap_json_request_handler(h):
|
|||
logger.info(
|
||||
"%s SynapseError: %s - %s", request, code, e.msg
|
||||
)
|
||||
respond_with_json(
|
||||
request, code, e.error_dict(), send_cors=True,
|
||||
pretty_print=_request_user_agent_is_curl(request),
|
||||
)
|
||||
|
||||
# Only respond with an error response if we haven't already started
|
||||
# writing, otherwise lets just kill the connection
|
||||
if request.startedWriting:
|
||||
if request.transport:
|
||||
try:
|
||||
request.transport.abortConnection()
|
||||
except Exception:
|
||||
# abortConnection throws if the connection is already closed
|
||||
pass
|
||||
else:
|
||||
respond_with_json(
|
||||
request, code, e.error_dict(), send_cors=True,
|
||||
pretty_print=_request_user_agent_is_curl(request),
|
||||
)
|
||||
|
||||
except Exception:
|
||||
# failure.Failure() fishes the original Failure out
|
||||
|
@ -100,16 +111,26 @@ def wrap_json_request_handler(h):
|
|||
request,
|
||||
f.getTraceback().rstrip(),
|
||||
)
|
||||
respond_with_json(
|
||||
request,
|
||||
500,
|
||||
{
|
||||
"error": "Internal server error",
|
||||
"errcode": Codes.UNKNOWN,
|
||||
},
|
||||
send_cors=True,
|
||||
pretty_print=_request_user_agent_is_curl(request),
|
||||
)
|
||||
# Only respond with an error response if we haven't already started
|
||||
# writing, otherwise lets just kill the connection
|
||||
if request.startedWriting:
|
||||
if request.transport:
|
||||
try:
|
||||
request.transport.abortConnection()
|
||||
except Exception:
|
||||
# abortConnection throws if the connection is already closed
|
||||
pass
|
||||
else:
|
||||
respond_with_json(
|
||||
request,
|
||||
500,
|
||||
{
|
||||
"error": "Internal server error",
|
||||
"errcode": Codes.UNKNOWN,
|
||||
},
|
||||
send_cors=True,
|
||||
pretty_print=_request_user_agent_is_curl(request),
|
||||
)
|
||||
|
||||
return wrap_async_request_handler(wrapped_request_handler)
|
||||
|
||||
|
|
|
@ -58,7 +58,9 @@ REQUIREMENTS = {
|
|||
"phonenumbers>=8.2.0": ["phonenumbers"],
|
||||
"six": ["six"],
|
||||
"prometheus_client": ["prometheus_client"],
|
||||
"attrs": ["attr"],
|
||||
|
||||
# we use attr.s(slots), which arrived in 16.0.0
|
||||
"attrs>=16.0.0": ["attr>=16.0.0"],
|
||||
"netaddr>=0.7.18": ["netaddr"],
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ class DownloadResource(Resource):
|
|||
b" script-src 'none';"
|
||||
b" plugin-types application/pdf;"
|
||||
b" style-src 'unsafe-inline';"
|
||||
b" media-src 'self';"
|
||||
b" object-src 'self';"
|
||||
)
|
||||
server_name, media_id, name = parse_media_id(request)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue