WIP: Manually rollback transactions to avoid spurious savepoint failure

TODO:
- Avoid unwrapping transaction after f(tx)
- Remove duplication between `transaction` and `room_transaction`
- Introduce random delay before and after committing a transaction
- Run lots of randomized tests
- Investigate diverging diagnostic summaries

Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-12-02 20:36:50 +01:00
parent 1c30767592
commit d96f524fb6
2 changed files with 300 additions and 269 deletions

File diff suppressed because it is too large Load diff

View file

@ -1854,9 +1854,7 @@ async fn leave_room_for_session(session: &Session) -> Result<()> {
let live_kit_room;
let delete_live_kit_room;
{
let Some(mut left_room) = session.db().await.leave_room(session.connection_id).await? else {
return Err(anyhow!("no room to leave"))?;
};
let mut left_room = session.db().await.leave_room(session.connection_id).await?;
contacts_to_update.insert(session.user_id);
for project in left_room.left_projects.values() {