| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
0.5's `FailureOption` no longer accepts a bare `{ type }` shape — a failure
must be an `Error` or carry an `error: Error`. This aligns stack with
`@cipherstash/auth` 0.41 (which already ships 0.5's Result) and unblocks the
tracked byteslice migration.
- `EncryptionError` gains a required `error: Error` holding the originating
error; `type` / `message` / `code` are unchanged, so readers of
`result.failure.*` are unaffected.
- New `toEncryptionError(type, error, code?)` factory coerces any caught value
to a real `Error` (never an unchecked `as Error`) and derives the message;
all 27 hand-built failure literals across encryption/* + identity now route
through it.
Verified: `tsc` clean, `tsup` build clean, biome clean. Offline suites
(validation, wasm-inline strategy, cjs-require) pass; remaining suite failures
are the pre-existing live-integration tests that need local CipherStash creds.
🦋 Changeset detectedLatest commit: 19331ac The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Sorry, something went wrong.
|
Warning Review limit reached@coderdan, you've reached your PR review limit, so we couldn't start this review. Next review available in: 30 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR. To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 1dca9bfc-49e6-4102-b3ca-921c3c77353a 📥 CommitsReviewing files that changed from the base of the PR and between 7dba25d and 19331ac. ⛔ Files ignored due to path filters (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
There was a problem hiding this comment.
Upgrade @cipherstash/stack to @byteslice/result@0.5.0 by updating the EncryptionError failure shape to satisfy the new FailureOption requirements, and mechanically refactoring stack operations/identity flows to construct failures via a shared factory.
Changes:
Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file| File | Description |
|---|---|
| pnpm-lock.yaml | Locks @byteslice/result@0.5.0 for packages/stack. |
| packages/stack/package.json | Updates stack’s direct dependency pin to 0.5.0. |
| packages/stack/src/errors/index.ts | Updates EncryptionError contract and adds toEncryptionError factory. |
| packages/stack/src/identity/index.ts | Migrates CTS-token failure mapping to toEncryptionError. |
| packages/stack/src/encryption/index.ts | Migrates client-init failure mapping to toEncryptionError. |
| packages/stack/src/encryption/helpers/validation.ts | Updates validation failure results to include a real Error via the factory. |
| packages/stack/src/encryption/operations/encrypt.ts | Migrates encryption failure mapping to toEncryptionError. |
| packages/stack/src/encryption/operations/decrypt.ts | Migrates decryption failure mapping to toEncryptionError. |
| packages/stack/src/encryption/operations/encrypt-query.ts | Migrates encryptQuery failure mapping to toEncryptionError. |
| packages/stack/src/encryption/operations/encrypt-model.ts | Migrates encryptModel failure mapping to toEncryptionError. |
| packages/stack/src/encryption/operations/decrypt-model.ts | Migrates decryptModel failure mapping to toEncryptionError. |
| packages/stack/src/encryption/operations/bulk-encrypt.ts | Migrates bulkEncrypt failure mapping to toEncryptionError. |
| packages/stack/src/encryption/operations/bulk-decrypt.ts | Migrates bulkDecrypt failure mapping to toEncryptionError. |
| packages/stack/src/encryption/operations/bulk-encrypt-models.ts | Migrates bulkEncryptModels failure mapping to toEncryptionError. |
| packages/stack/src/encryption/operations/bulk-decrypt-models.ts | Migrates bulkDecryptModels failure mapping to toEncryptionError. |
| packages/stack/src/encryption/operations/batch-encrypt-query.ts | Migrates batch encryptQuery failure mapping to toEncryptionError. |
| .changeset/byteslice-result-0-5.md | Declares a minor release for the dependency + failure-shape change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
|
|
||
| /** | ||
| * Build an {@link EncryptionError} from a caught value. | ||
| * | ||
| * `@byteslice/result` 0.5 requires a failure to be an `Error` or to carry an |
| const err = error instanceof Error ? error : new Error(getErrorMessage(error)) | ||
| return code === undefined | ||
| ? { type, message: err.message, error: err } | ||
| : { type, message: err.message, code, error: err } | ||
| } |
| Back | FazBrowse Home | New Git URL |
What
Upgrade @cipherstash/stack's @byteslice/result dependency from 0.2.0 → 0.5.0, resolving the breaking change to the Result failure model. Follows on from #568 (auth 0.41, now merged, already ships 0.5's Result).
Why
@byteslice/result 0.5's FailureOption no longer accepts a bare { type: string } shape — a failure must be an Error or carry an error: Error. Stack's EncryptionError ({ type; message; code? }) satisfied 0.2 but not 0.5, so every Result<…, EncryptionError> usage broke (78 type errors across 15 files). This unblocks the tracked byteslice alignment and removes a version skew with auth 0.41.
How
Verification
Scope
https://claude.ai/code/session_01RRUEHiYupwGo6eEWTBhRaj