Repository navigation
Commit 81c27ca
state_append: tighten docstring on idempotency scope (review §1)
The previous docstring said "replay returns prior ordinal" without
qualifying scope, which would mislead a future caller into assuming
end-to-end exactly-once. The internal attempt_id only protects
*transport-layer* retries within one backend call:
* CfDo's HTTP retry loop sits above attempt_id generation, so retried
requests carry the same id and the server replays correctly.
* Azure SQL's _execute_with_retry reruns the closure with the captured
id, so DB-driver retries replay correctly.
* SQLite has no retry layer above this method at all; the
INSERT OR IGNORE + SELECT-by-attempt_id pattern is currently
unreachable from any caller (the public signature generates a fresh
UUID4 per call). Pattern is kept for symmetry with the other backends
and to leave room for future caller-supplied attempt_id.
Caller-level retries generate a fresh internal id and produce duplicate
rows. Documented on both FunctionStorage.state_append (Protocol) and
BoundStorage.state_append (facade). Updated the misleading "On conflict
the row already exists" comment in the SQLite implementation to reflect
that the conflict path is currently unreachable.
Test: pin the duplicate-on-caller-retry behavior so any future change
that exposes caller-supplied attempt_id will deliberately break it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f4ac15e commit 81c27ca
2 files changed
Lines changed: 45 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
263 | 278 | | |
264 | 279 | | |
265 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
370 | 377 | | |
371 | 378 | | |
372 | 379 | | |
| |||
602 | 609 | | |
603 | 610 | | |
604 | 611 | | |
605 | | - | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
606 | 620 | | |
607 | 621 | | |
608 | 622 | | |
| |||
1099 | 1113 | | |
1100 | 1114 | | |
1101 | 1115 | | |
1102 | | - | |
| 1116 | + | |
1103 | 1117 | | |
1104 | 1118 | | |
1105 | 1119 | | |
1106 | 1120 | | |
1107 | 1121 | | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
1112 | 1131 | | |
1113 | 1132 | | |
1114 | 1133 | | |
| |||
0 commit comments