Code RoomOffset commits before processing
HardPrep Room Coding #1940

Offset commits before processing

Code reviewNetworking & APIsSenior–Staff~22 min

Review this Go Kafka-style consumer that processes each message and then commits its offset.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix, specific and kind.

0:00 of about 22 min
Mark a line and say what kind of problem it is.0 findings
1for msg := range messages {
2 if err := applyCharge(msg.Value); err != nil {
3 log.Printf("apply failed: %v", err)
4 continue
5 }
6 if err := consumer.Commit(msg); err != nil {
7 log.Printf("commit failed: %v", err)
8 }
9}
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.