You need to review a small PR in the module that builds a snapshot of the team members' activity from shared state. After the changes, two observable symptoms started appearing: some elements disappear from the result without an error, and with parallel calls the final counter of processed members sometimes decreases or lags behind reality.
build_snapshot method takes a member_ids list and a preview flag.member_id you need to:
active == false, skip it;note == None, return an error;"<id>: <note>" to the result.preview == true mode, state must not change.preview == false mode, processed_count must increase by the number of lines actually added in the current call.u1 is active, note = Some("ready");u2 is active, note = None;u3 is inactive, note = Some("offline").build_snapshot(vec!["u1", "u2"], true).u2, not succeed with a partial result.build_snapshot calls on different sets of active members with valid notes.processed_count.processed_count increases exactly by the number of lines added by that call.processed_count must match the sum of all their contributions without lost updates.1.85.02021Arc<Mutex<_>>build_snapshot may be called concurrently from different threads in one processUse line comments to explain the problem, its impact, the fix and how to test it.