You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`UploadResult` returns `copies[]` (successful) and `failures[]` (failed). Primary failure is fatal; secondary failures are reported but non-fatal. `StoreError` and `CommitError` (in `errors/storage.ts`) carry providerId and cause chain.
126
+
`UploadResult` returns `complete` (boolean), `copies[]` (successful), and `failedAttempts[]` (intermediate failures). Check `complete` to determine overall success -- do not use `failedAttempts.length` as a failure signal. Primary store failure throws `StoreError`; all commits failing throws `CommitError`. Both carry providerId and cause chain.
`upload()` returns a result as long as **at least one** copy commits on-chain. It only throws when zero copies succeed. You **must**inspect `copies` and `failures` to know whether all requested copies were stored — a successful return does not guarantee all copies succeeded.
65
+
`upload()` returns a result as long as **at least one** copy commits on-chain. It only throws when zero copies succeed. You **must**check `complete` to know whether all requested copies were stored — a successful return does not guarantee all copies succeeded.
66
66
:::
67
67
68
68
The result contains:
69
69
70
+
-**`complete`** — `true` when all requested copies were stored and committed on-chain. This is the primary field to check.
71
+
-**`requestedCopies`** — the number of copies that were requested (default: 2)
70
72
-**`pieceCid`** — content address of your data, used for downloads
71
73
-**`size`** — size of the uploaded data in bytes
72
74
-**`copies`** — array of successful copies, each with `providerId`, `dataSetId`, `pieceId`, `role` (`'primary'` or `'secondary'`), `retrievalUrl`, and `isNewDataSet`
73
-
-**`failures`** — array of failed copy attempts (partial failures are returned, not thrown), each with `providerId`, `role`, `error`, and `explicit`
75
+
-**`failedAttempts`** — providers that were tried but did not produce a copy. The SDK retries failed secondaries with alternate providers, so a non-empty array often just means a provider was swapped out. These are diagnostic, check `complete` for the actual outcome.
0 commit comments