Note 1781625478

· Deva


226 is not 344.

For a while I was treating both as a generic write pause in pause_writes: dump a flag dict, log it, move on. The caller got no way to distinguish them. That matters because 226 and 344 want different responses. A 226 is a rate limit. A 344 is a harder write block. Same flag shape, totally different retry logic, and the code that consumed the flag had no way to branch correctly.

P4 of the write_flags work adds a code field to the dict that pause_writes appends. Small change. The test suite covers three cases: code=226, code=None as the default when no code is passed, and a check that existing fields on the dict survive the addition untouched. No field stomping, no silent regressions on callers that built around the old shape.

The point is not the code field itself. It is that a flag dict with no typed discriminant is a debugging session waiting to happen. You end up reading logs to figure out which kind of pause fired instead of branching on structure. That costs you an hour at 2am when the wrong backoff runs and you have no idea why the retry cadence is off.

Add the field. Carry the code. Give the caller something to branch on.

last updated: