mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Fix background update to handle invalid events (#17641)
Follow-up to #17634, https://github.com/element-hq/synapse/pull/17631 and https://github.com/element-hq/synapse/pull/17632 to fix-up https://github.com/element-hq/synapse/pull/17512
This commit is contained in:
parent
b054690c8c
commit
b09bcf16d9
1
changelog.d/17641.misc
Normal file
1
changelog.d/17641.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Pre-populate room data used in experimental [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575) Sliding Sync `/sync` endpoint for quick filtering/sorting.
|
@ -41,7 +41,10 @@ from synapse.storage.databases.main.events import (
|
|||||||
SlidingSyncMembershipSnapshotSharedInsertValues,
|
SlidingSyncMembershipSnapshotSharedInsertValues,
|
||||||
SlidingSyncStateInsertValues,
|
SlidingSyncStateInsertValues,
|
||||||
)
|
)
|
||||||
from synapse.storage.databases.main.events_worker import DatabaseCorruptionError
|
from synapse.storage.databases.main.events_worker import (
|
||||||
|
DatabaseCorruptionError,
|
||||||
|
InvalidEventError,
|
||||||
|
)
|
||||||
from synapse.storage.databases.main.state_deltas import StateDeltasStore
|
from synapse.storage.databases.main.state_deltas import StateDeltasStore
|
||||||
from synapse.storage.databases.main.stream import StreamWorkerStore
|
from synapse.storage.databases.main.stream import StreamWorkerStore
|
||||||
from synapse.storage.types import Cursor
|
from synapse.storage.types import Cursor
|
||||||
@ -2089,7 +2092,7 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
|
|||||||
fetched_events = await self.get_events(
|
fetched_events = await self.get_events(
|
||||||
current_state_ids_map.values()
|
current_state_ids_map.values()
|
||||||
)
|
)
|
||||||
except DatabaseCorruptionError as e:
|
except (DatabaseCorruptionError, InvalidEventError) as e:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"Failed to fetch state for room '%s' due to corrupted events. Ignoring. Error: %s",
|
"Failed to fetch state for room '%s' due to corrupted events. Ignoring. Error: %s",
|
||||||
room_id,
|
room_id,
|
||||||
@ -2197,7 +2200,7 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
fetched_events = await self.get_events(state_ids_map.values())
|
fetched_events = await self.get_events(state_ids_map.values())
|
||||||
except DatabaseCorruptionError as e:
|
except (DatabaseCorruptionError, InvalidEventError) as e:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"Failed to fetch state for room '%s' due to corrupted events. Ignoring. Error: %s",
|
"Failed to fetch state for room '%s' due to corrupted events. Ignoring. Error: %s",
|
||||||
room_id,
|
room_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user