Problem
WriteResult::parse only reports a write as failed when the response's ok field is 0. But a duplicate-key error on an insert answers ok: 1 together with a writeErrors array describing the actual failure — so a host that trusts WriteResult::parse's pass/fail verdict alone will silently treat a failed insert as successful.
Why it matters
This is exactly the kind of defect that is invisible until it happens in production: the server told the driver about the failure (writeErrors), but the crate's own summary type didn't surface it. Perry's P7 lane flagged that the safe order — checking Error::from_response before trusting WriteResult::parse's verdict — "is not stated anywhere" in the crate's documentation.
What would fix it
Either WriteResult::parse itself should check for a non-empty writeErrors array and treat that as failure regardless of ok, or, short of that, the crate's documentation should state explicitly that callers must check Error::from_response first and cannot rely on WriteResult::parse's verdict alone.
Problem
WriteResult::parseonly reports a write as failed when the response'sokfield is0. But a duplicate-key error on an insert answersok: 1together with awriteErrorsarray describing the actual failure — so a host that trustsWriteResult::parse's pass/fail verdict alone will silently treat a failed insert as successful.Why it matters
This is exactly the kind of defect that is invisible until it happens in production: the server told the driver about the failure (
writeErrors), but the crate's own summary type didn't surface it. Perry's P7 lane flagged that the safe order — checkingError::from_responsebefore trustingWriteResult::parse's verdict — "is not stated anywhere" in the crate's documentation.What would fix it
Either
WriteResult::parseitself should check for a non-emptywriteErrorsarray and treat that as failure regardless ofok, or, short of that, the crate's documentation should state explicitly that callers must checkError::from_responsefirst and cannot rely onWriteResult::parse's verdict alone.