Commit 6745ed0
Clarify queueStrategy documentation (#1107)
* docs: clarify queueStrategy error handling behavior
The previous documentation implied that "every mutation is guaranteed
to persist" which is misleading. This clarifies that:
- Every mutation is guaranteed to be ATTEMPTED (not dropped)
- Failed mutations are NOT automatically retried
- Failed mutations transition to "failed" state
- Subsequent mutations continue processing (queue doesn't stop)
- Each mutation is independent (no all-or-nothing semantics)
Fixes #1071
* docs: add retry behavior documentation and examples
TanStack DB does not automatically retry failed mutations - this is by
design since retry strategies vary by use case. This commit:
- Adds a "Retry Behavior" section explaining why auto-retry isn't built-in
- Provides a simple retry helper example with exponential backoff
- Adds a queue strategy-specific retry example for file uploads
- References p-retry library for more sophisticated strategies
This helps answer the question from #1071 about what happens when
mutations fail and how to handle retries.
* docs: remove duplicative retry example from queue strategy section
Link to the Retry Behavior section instead of duplicating the example.
* docs: revert manual edit to generated reference doc
The queueStrategy.md reference doc is auto-generated from JSDoc in
the source file - the source already has the updated documentation.
* chore: add changeset for queue strategy docs clarification
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* docs: address review feedback on punctuation and backoff description
- Replace em-dash with period for clarity (Kevin's feedback)
- Fix "exponential backoff" comment to "increasing delay" since the
code uses linear backoff (Kyle's earlier feedback)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
---------
Co-authored-by: Claude <[email protected]>1 parent bdf9405 commit 6745ed0
3 files changed
Lines changed: 61 additions & 4 deletions
File tree
- .changeset
- docs/guides
- packages/db/src/strategies
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1093 | 1093 | | |
1094 | 1094 | | |
1095 | 1095 | | |
1096 | | - | |
| 1096 | + | |
1097 | 1097 | | |
1098 | 1098 | | |
1099 | 1099 | | |
| |||
1136 | 1136 | | |
1137 | 1137 | | |
1138 | 1138 | | |
1139 | | - | |
| 1139 | + | |
1140 | 1140 | | |
1141 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
1142 | 1149 | | |
1143 | 1150 | | |
1144 | 1151 | | |
| |||
1453 | 1460 | | |
1454 | 1461 | | |
1455 | 1462 | | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
1456 | 1502 | | |
1457 | 1503 | | |
1458 | 1504 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
| |||
0 commit comments