chore: add information about object id to log errors in apply update (#1315)

This commit is contained in:
Bartosz Sypytkowski 2025-04-03 08:59:24 +02:00 committed by GitHub
parent 0160be6ac6
commit ac834adc2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -978,8 +978,9 @@ impl CollabPersister {
for (message_id, update) in updates {
i += 1;
let update: Update = update.into_update()?;
tx.apply_update(update)
.map_err(|err| RTProtocolError::YrsApplyUpdate(err.to_string()))?;
tx.apply_update(update).map_err(|err| {
RTProtocolError::YrsApplyUpdate(format!("collab {} - {}", self.object_id, err))
})?;
last_message_id = Some(message_id); //TODO: shouldn't this happen before decoding?
self.metrics.apply_update_count.inc();
}
@ -1030,10 +1031,9 @@ impl CollabPersister {
})
};
let collab = collab.as_mut().unwrap();
collab
.transact_mut()
.apply_update(update)
.map_err(|err| RTProtocolError::YrsApplyUpdate(err.to_string()))?;
collab.transact_mut().apply_update(update).map_err(|err| {
RTProtocolError::YrsApplyUpdate(format!("collab {} - {}", self.object_id, err))
})?;
last_message_id = Some(message_id); //TODO: shouldn't this happen before decoding?
self.metrics.apply_update_count.inc();
}