You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Currently when we calculate the state group for a new event we always fetch the full state from the DB, even when no state resolution happens. This is then stored in the EventContext, which is access via context.get_prev_state_ids() and get_current_state_ids().
Historically, we needed to store the state in EventContext as we may not have persisted it yet. However, nowadays we always store the state group for the new event before we create EventContext, so we can rely on being able to fetch the state from the DB.
I suggest we:
Remove the cached state from EventContext and instead fetch state from the DB each time (relying on the caching to minimise performance problems)
Ensure the state handler doesn't fetch the full state from the DB when there are no conflicts
Change the EventContext methods to accept a StateFilter and use those everywhere.