A small service stores member cards in memory and can rename a public name while writing an entry to an external log. After a recent PR, the behavior started to diverge from what was expected: some valid requests began to be rejected, and when log writing fails, the log and the service state may diverge.
rename_member method takes member_id and a new public name."" is considered a valid new name and means the name should be cleared.rename_count must increase only after the log entry is written successfully.member:<id>:<name>.src/lib.rs.rename_member(1, Some("".to_string()))writerename_member for an existing memberrename_countSome("".to_string()) succeeds and preserves the empty value.Err without changing the member card.rename_count does not increase.1.85.02021review — you need to find defects in the change after the PRcargo test or cargo checkUse line comments to explain the problem, its impact, the fix and how to test it.