@tinycloud/web-sdk 3.3.0-beta.24 → 3.3.0-beta.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -216,6 +216,15 @@ measured on canonical CI against master `c7a379c5`: master 1,474,761 / 1,403,138
216
216
  root ceilings to exactly those bytes. The ledger's `tc1476Ratchet` row records it and cannot change later;
217
217
  whichever PR lands after it re-measures against the new base and updates its own row.
218
218
 
219
+ TC-1475 (automatic retry of node 503 busy and request_timeout responses in `ServiceContext.invokeWithRetry`, which
220
+ re-signs the invocation on every attempt, plus the web-sdk and node-sdk `retryPolicy` config, #599) was measured
221
+ against master `5317cc78` and sits on top of TC-1476's root ceilings and TC-1432's first-import, activation and
222
+ worker ceilings. GitHub run 39292038037 on source `092144080` measured the same bytes in both Node jobs: root
223
+ 1,475,166 / 1,403,595 B (+358 / +404 over the merge base; ceilings exactly the measured values), first import 51,925 / 67,140 B (0 / +2),
224
+ activation 23,117 / 24,699 B (+11 / +14) and the kv-storage worker 822,667 B (+623). The
225
+ ledger's `tc1475Ratchet` row records it and cannot change later;
226
+ whichever PR lands after it re-measures against the new base and updates its own row.
227
+
219
228
  **Ancestry pins and squash merges.** A policy row records the PR-branch commit it
220
229
  was reviewed at, and its introduction check requires that literal commit in the
221
230
  PR head. js-sdk uses merge commits, which keep that commit reachable, but squash
@@ -321,6 +330,22 @@ await storage.delete('messages/welcome');
321
330
  await storage.deleteAll('user');
322
331
  ```
323
332
 
333
+ ### Automatic retry
334
+
335
+ When the node answers `503` busy (`NODE_BUSY`) or `503` request timeout (`REQUEST_TIMEOUT`), it
336
+ applied nothing, so the SDK retries on its own: up to 4 attempts in about 12 s, waiting the node's
337
+ `Retry-After` when sent, otherwise exponentially with full jitter (250 ms base, 4 s cap). It stops
338
+ early on abort or the per-request `timeout`, and returns the last typed error once the budget is
339
+ spent. `OUTCOME_UNKNOWN` is never retried. Tune or opt out with `retryPolicy`; `{ maxAttempts: 1 }`
340
+ (or `retryableErrors: []`) disables it. Monitors and probes should disable retries. A successful KV response carries
341
+ `retry: { attempts, backoffMs }`, so latency can be split from backoff. The CLI disables retries
342
+ with `--no-retry` or `TINYCLOUD_RETRY=0`, and its `kv get|put|delete --json` output reports
343
+ `attempts` and `backoffMs`.
344
+
345
+ ```typescript
346
+ const tcw = new TinyCloudWeb({ retryPolicy: { maxAttempts: 1 } });
347
+ ```
348
+
324
349
  ## Core Values
325
350
 
326
351
  TinyCloud is built on these fundamental principles: