The service updates participant presence statuses based on a list of input commands and writes one audit line for the whole batch. After a recent PR, the behavior changed: some invalid input data no longer aborts the operation as before, and the service’s internal state sometimes appears updated even when audit writing fails.
apply_presence_batch method accepts a set of PresenceUpdate commands.Directory::load_member;<id>:<status>;PresenceService state.applied_batches counter must increase only after successful audit writing and application of all prepared changes.AuditLog::write_batch must be called once for the entire batch.apply_presence_batch with two commands where:
AuditLog returning a write error.Example input commands:
vec![
PresenceUpdate { member_id: 1, status: "online".into() },
PresenceUpdate { member_id: 9, status: "away".into() },
]
AuditLog::write_batch fails, the presence_by_id map and the applied_batches counter must remain unchanged.1.85.02021src/lib.rsAuditLog::write_batch is an external operation that can failUse line comments to explain the problem, its impact, the fix and how to test it.