Since #6478, the BaseStateStore uses a SaveLockedStateStore to ensure that calls to the underlying StateStore::save_changes are synchronized. It likely makes sense, however, to synchronize calls to other StateStore functions which may interfere with StateStore::save_changes, if they are not also synchronized.
Below is a list of StateStore functions which write to the database (other than StateStore::save_changes).
set_kv_data
remove_kv_data
set_custom_value
remove_custom_value
remove_room
save_send_queue_request
update_send_queue_request
remove_send_queue_request
update_send_queue_request_status
save_dependent_queued_request
mark_dependent_queued_requests_as_ready
update_dependent_queued_request
remove_dependent_queued_request
upsert_thread_subscription
remove_thread_subscription
set_custom_value_no_read
It seems the most relevant function is (5) remove_room. But there may be others in this list which might benefit from being synchronized.
Since #6478, the
BaseStateStoreuses aSaveLockedStateStoreto ensure that calls to the underlyingStateStore::save_changesare synchronized. It likely makes sense, however, to synchronize calls to otherStateStorefunctions which may interfere withStateStore::save_changes, if they are not also synchronized.Below is a list of
StateStorefunctions which write to the database (other thanStateStore::save_changes).set_kv_dataremove_kv_dataset_custom_valueremove_custom_valueremove_roomsave_send_queue_requestupdate_send_queue_requestremove_send_queue_requestupdate_send_queue_request_statussave_dependent_queued_requestmark_dependent_queued_requests_as_readyupdate_dependent_queued_requestremove_dependent_queued_requestupsert_thread_subscriptionremove_thread_subscriptionset_custom_value_no_readIt seems the most relevant function is (5)
remove_room. But there may be others in this list which might benefit from being synchronized.