Skip to content

Conversation

@ryanbas21
Copy link
Collaborator

@ryanbas21 ryanbas21 commented Jan 2, 2026

JIRA Ticket

https://pingidentity.atlassian.net/browse/SDKS-4446

Description

update to use a typeguard from sdk-utilities to help clean up checks for genericerror. then implement in davinci-client where we need to check for the generic error

Summary by CodeRabbit

  • Bug Fixes

    • Improved storage error handling for custom stores and resume/external-IDP flows, returning structured error responses and adding clearer logging.
  • Chores

    • Added a shared error utility and tests, updated TypeScript project references, and introduced the new utilities as a workspace dependency.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Jan 2, 2026

🦋 Changeset detected

Latest commit: 3c63979

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@forgerock/davinci-client Patch
@forgerock/sdk-utilities Patch
@forgerock/storage Patch
@forgerock/journey-client Patch
@forgerock/sdk-oidc Patch
@forgerock/oidc-client Patch
@forgerock/device-client Patch
@forgerock/protect Patch
@forgerock/sdk-types Patch
@forgerock/iframe-manager Patch
@forgerock/sdk-logger Patch
@forgerock/sdk-request-middleware Patch

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 2, 2026

📝 Walkthrough

Walkthrough

Adds an isGenericError utility in a new sdk-utilities package, wires it into davinci-client (dependency and TS refs), updates davinci-client to explicitly handle storage-read/write/remove errors using the type guard, and wraps custom storage get/set/remove calls to return structured storage errors on exceptions.

Changes

Cohort / File(s) Summary
davinci-client configuration
packages/davinci-client/package.json, packages/davinci-client/tsconfig.json, packages/davinci-client/tsconfig.lib.json
Add workspace dependency @forgerock/sdk-utilities and TypeScript project references to ../sdk-utilities / ../sdk-utilities/tsconfig.lib.json.
davinci-client error handling
packages/davinci-client/src/lib/client.store.ts
Use isGenericError to detect storage-returned GenericError values; replace broad try/catch with explicit storage reads/writes/removes, log failures, and return structured InternalErrorResponse objects on errors.
sdk-utilities package setup
packages/sdk-utilities/package.json, packages/sdk-utilities/tsconfig.json, packages/sdk-utilities/tsconfig.lib.json
Add package dependency on @forgerock/sdk-types and TypeScript references to sdk-types for composite builds.
sdk-utilities error utilities
packages/sdk-utilities/src/lib/error/error.utils.ts, packages/sdk-utilities/src/lib/error/index.ts, packages/sdk-utilities/src/index.ts
New isGenericError(value: unknown): value is GenericError type guard implemented and re-exported from the error index and package entry.
sdk-utilities tests
packages/sdk-utilities/src/lib/error/error.utils.test.ts
New Vitest test suite covering positive and negative cases for isGenericError.
storage effects
packages/sdk-effects/storage/src/lib/storage.effects.ts
Wrap custom storage get/set/remove calls in try/catch and return structured storage errors (via createStorageError) on exceptions; preserve non-custom paths.
changeset
.changeset/fix-storage-error-handling.md
Changeset describing addition of isGenericError and storage/davinci-client error-handling fixes.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Storage
  participant State

  Client->>Storage: get(serverInfoKey)
  alt Storage returns GenericError
    Storage-->>Client: GenericError
    Client->>Client: log error
    Client-->>Client: return InternalErrorResponse
  else Storage returns serverInfo
    Storage-->>Client: serverInfo
    Client->>State: dispatch resume(serverInfo)
    State-->>Client: updated node/state
    Client->>Storage: remove(serverInfoKey)
    alt remove returns GenericError
      Storage-->>Client: GenericError
      Client->>Client: log warning
    else remove success
      Storage-->>Client: null
    end
    Client-->>Client: return current node
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • cerebrl

Poem

🐰 I hopped in with a tiny guard so bright,
It sniffed out shadowed errors in the night.
Storage now speaks clearly, no more guessing games,
Clients resume with logs and steadier frames,
Hooray — a carrot-coded fix takes flight! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title mentions 'update-storage-client-error-handling' but the PR encompasses broader changes including new type guards and improvements to davinci-client error handling, not just storage client updates. Consider a more comprehensive title such as 'fix: add isGenericError type guard and improve error handling' to better reflect all affected packages and changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description includes the required JIRA ticket reference and provides a clear, concise summary of the changes including the new type guard and its implementation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between af4bf4c and 86c00eb.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • packages/davinci-client/package.json
  • packages/davinci-client/src/lib/client.store.ts
  • packages/davinci-client/tsconfig.json
  • packages/davinci-client/tsconfig.lib.json
  • packages/sdk-utilities/package.json
  • packages/sdk-utilities/src/index.ts
  • packages/sdk-utilities/src/lib/error/error.utils.test.ts
  • packages/sdk-utilities/src/lib/error/error.utils.ts
  • packages/sdk-utilities/src/lib/error/index.ts
  • packages/sdk-utilities/tsconfig.json
  • packages/sdk-utilities/tsconfig.lib.json
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ancheetah
Repo: ForgeRock/ping-javascript-sdk PR: 417
File: packages/sdk-effects/storage/src/lib/storage.effects.ts:11-12
Timestamp: 2025-09-23T20:50:26.537Z
Learning: When the storage client API was changed from returning void to GenericError | null in SDKS-4361, call sites in DaVinci client and OIDC client were not updated to handle the returned errors, creating a follow-up task for proper error handling implementation.
📚 Learning: 2025-09-23T20:50:26.537Z
Learnt from: ancheetah
Repo: ForgeRock/ping-javascript-sdk PR: 417
File: packages/sdk-effects/storage/src/lib/storage.effects.ts:11-12
Timestamp: 2025-09-23T20:50:26.537Z
Learning: When the storage client API was changed from returning void to GenericError | null in SDKS-4361, call sites in DaVinci client and OIDC client were not updated to handle the returned errors, creating a follow-up task for proper error handling implementation.

Applied to files:

  • packages/davinci-client/src/lib/client.store.ts
🔇 Additional comments (14)
packages/sdk-utilities/package.json (1)

39-41: LGTM! Dependency correctly added.

The addition of @forgerock/sdk-types as a workspace dependency is appropriate for accessing the GenericError type in the new type guard utility.

packages/davinci-client/package.json (1)

30-30: LGTM! Dependency correctly added.

The addition of @forgerock/sdk-utilities enables the davinci-client to use the new isGenericError type guard for cleaner error handling. Based on learnings, this addresses the follow-up task for proper error handling after storage client API changes in SDKS-4361.

packages/sdk-utilities/tsconfig.lib.json (1)

22-26: LGTM! TypeScript reference correctly configured.

The project reference to sdk-types enables proper type resolution and composite builds, correctly mirroring the package dependency added in package.json.

packages/sdk-utilities/src/index.ts (1)

10-10: LGTM! Public API export correctly added.

The new error utilities export properly surfaces the isGenericError type guard to consuming packages.

Note: The actual implementation files (error.utils.ts, error/index.ts) and their tests were not included in this review. Ensure these have been reviewed separately or include them for comprehensive feedback.

packages/davinci-client/tsconfig.json (1)

16-18: LGTM! TypeScript reference correctly configured.

The project reference to sdk-utilities enables proper type resolution for the new isGenericError utility, correctly mirroring the package dependency.

Note: The actual usage of isGenericError in davinci-client source files was not included in this review. Ensure error handling call sites have been updated and reviewed separately.

packages/sdk-utilities/src/lib/error/index.ts (1)

8-8: LGTM!

Clean re-export pattern establishing the public API surface for the error utilities.

packages/davinci-client/tsconfig.lib.json (1)

37-39: LGTM!

The TypeScript project reference correctly enables the davinci-client package to consume types and utilities from sdk-utilities.

packages/sdk-utilities/tsconfig.json (1)

6-8: LGTM!

The project reference correctly establishes the dependency on sdk-types, enabling the import of the GenericError type.

packages/sdk-utilities/src/lib/error/error.utils.ts (1)

1-15: LGTM!

Clean import and well-documented function signature.

packages/sdk-utilities/src/lib/error/error.utils.test.ts (2)

1-11: LGTM!

Proper test setup with all necessary imports.


12-59: LGTM!

The success test cases provide good coverage for valid GenericError objects with varying field completeness.

packages/davinci-client/src/lib/client.store.ts (3)

130-141: Proper error handling for storage set operation.

The implementation correctly captures the storage result, checks for errors using the type guard, logs appropriately, and returns a structured error response. This addresses the known gap from the retrieved learning where storage errors weren't being handled.

Minor note: The explicit return; on line 140 is optional in TypeScript when the return type includes void, but it does provide clarity in this async context.

Based on learnings, this change properly implements the follow-up task to handle storage API errors.


209-247: Excellent structured error handling for the resume flow.

The implementation properly handles multiple error scenarios:

  • Null storage result (lines 211-221) with a helpful user-facing message
  • GenericError from get operation (lines 223-234) with appropriate fallback
  • GenericError from remove operation (lines 240-243) as a non-blocking warning

The sequential approach (check null → check GenericError → proceed with success path) is clear and handles all edge cases. Using warn level for cleanup failures is appropriate since the resume operation itself succeeded.

Based on learnings, this change properly implements the follow-up task to handle storage API errors at the call site.


12-12: Import of isGenericError type guard is correct and well-utilized.

The isGenericError type guard is properly exported from @forgerock/sdk-utilities and is used appropriately throughout the file to check storage operation results for error handling (lines 131, 223, 241).

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Jan 6, 2026

View your CI Pipeline Execution ↗ for commit 3c63979

Command Status Duration Result
nx run-many -t build --no-agents ✅ Succeeded <1s View ↗
nx affected -t build lint test e2e-ci ✅ Succeeded 56s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-13 17:52:51 UTC

@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 28.94737% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.82%. Comparing base (b89ad58) to head (3c63979).
⚠️ Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
packages/davinci-client/src/lib/client.store.ts 0.00% 46 Missing ⚠️
...ges/sdk-effects/storage/src/lib/storage.effects.ts 66.66% 6 Missing ⚠️
packages/sdk-utilities/src/index.ts 0.00% 1 Missing ⚠️
packages/sdk-utilities/src/lib/error/index.ts 50.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (28.94%) is below the target coverage (40.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (18.82%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #510      +/-   ##
==========================================
+ Coverage   18.79%   18.82%   +0.02%     
==========================================
  Files         140      142       +2     
  Lines       27640    27726      +86     
  Branches      980      991      +11     
==========================================
+ Hits         5195     5219      +24     
- Misses      22445    22507      +62     
Files with missing lines Coverage Δ
...ackages/sdk-utilities/src/lib/error/error.utils.ts 100.00% <100.00%> (ø)
packages/sdk-utilities/src/index.ts 14.28% <0.00%> (-2.39%) ⬇️
packages/sdk-utilities/src/lib/error/index.ts 50.00% <50.00%> (ø)
...ges/sdk-effects/storage/src/lib/storage.effects.ts 60.57% <66.66%> (-0.97%) ⬇️
packages/davinci-client/src/lib/client.store.ts 0.31% <0.00%> (-0.05%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 6, 2026

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/davinci-client@510

@forgerock/device-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/device-client@510

@forgerock/journey-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/journey-client@510

@forgerock/oidc-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/oidc-client@510

@forgerock/protect

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/protect@510

@forgerock/sdk-types

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-types@510

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-utilities@510

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/iframe-manager@510

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-logger@510

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-oidc@510

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-request-middleware@510

@forgerock/storage

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/storage@510

commit: 3c63979

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Deployed c241d68 to https://ForgeRock.github.io/ping-javascript-sdk/pr-510/c241d6823a62a3f31a9ac12dc22508302bd08a01 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔺 @forgerock/sdk-utilities - 8.5 KB (+1.0 KB, +13.4%)
🔻 @forgerock/journey-client - 0.0 KB (-82.4 KB, -100.0%)

📊 Minor Changes

📉 @forgerock/journey-client - 82.4 KB (-0.0 KB)
📈 @forgerock/storage - 1.5 KB (+0.0 KB)
📈 @forgerock/davinci-client - 39.8 KB (+0.2 KB)

➖ No Changes

@forgerock/device-client - 9.2 KB
@forgerock/oidc-client - 23.4 KB
@forgerock/protect - 150.1 KB
@forgerock/sdk-types - 8.0 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/iframe-manager - 2.4 KB
@forgerock/sdk-request-middleware - 4.5 KB
@forgerock/sdk-oidc - 2.6 KB


13 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

Copy link
Collaborator

@cerebrl cerebrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good other than the complete removal of the try-catch.

davinciApi.endpoints.resume.initiate({ continueToken, serverInfo: storedServerInfo }),
);
await serverInfo.remove();
const storedServerInfo = await serverInfo.get();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we get rid of all try-catches, we have no protection from any uncaught runtime errors. This feel a bit risky to me. I know it's unlikely, but it's still non-zero.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So - storage client shouldn't throw to begin with. Looking at it though, we can improve this on custom storage by wrapping it itself.

We can keep the try catch to be overly defensive though.

or do both. What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern is that the try-catch was also wrapping the store.dispatch method as well, so the improvement of the storage implementation helps, but I'm not sure it's enough to remove the try-catches entirely. The amount of code that underlies the store.dispatch is enough to motivate a try-catch.

I think RTK avoids throwing, but I'm not entirely sure.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/sdk-effects/storage/src/lib/storage.effects.ts (1)

74-75: Consider logging or capturing the original error for debugging purposes.

The catch blocks discard the original exception. While the current approach provides consistent user-facing errors, capturing the original error could aid debugging in production. This is optional and can be deferred.

♻️ Optional: Capture original error for debugging
-        } catch {
+        } catch (e) {
+          // Optional: Log or include original error for debugging
+          // console.debug('Custom storage error:', e);
           return createStorageError(storeType, 'Retrieving');
         }

Apply similar pattern to set and remove catch blocks if needed.

Also applies to: 113-114, 130-131

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 86c00eb and b3ec032.

📒 Files selected for processing (4)
  • .changeset/fix-storage-error-handling.md
  • packages/sdk-effects/storage/src/lib/storage.effects.ts
  • packages/sdk-utilities/src/lib/error/error.utils.test.ts
  • packages/sdk-utilities/src/lib/error/error.utils.ts
✅ Files skipped from review due to trivial changes (1)
  • .changeset/fix-storage-error-handling.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/sdk-utilities/src/lib/error/error.utils.test.ts
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ancheetah
Repo: ForgeRock/ping-javascript-sdk PR: 417
File: packages/sdk-effects/storage/src/lib/storage.effects.ts:11-12
Timestamp: 2025-09-23T20:50:26.537Z
Learning: When the storage client API was changed from returning void to GenericError | null in SDKS-4361, call sites in DaVinci client and OIDC client were not updated to handle the returned errors, creating a follow-up task for proper error handling implementation.
📚 Learning: 2025-09-23T20:50:26.537Z
Learnt from: ancheetah
Repo: ForgeRock/ping-javascript-sdk PR: 417
File: packages/sdk-effects/storage/src/lib/storage.effects.ts:11-12
Timestamp: 2025-09-23T20:50:26.537Z
Learning: When the storage client API was changed from returning void to GenericError | null in SDKS-4361, call sites in DaVinci client and OIDC client were not updated to handle the returned errors, creating a follow-up task for proper error handling implementation.

Applied to files:

  • packages/sdk-effects/storage/src/lib/storage.effects.ts
🧬 Code graph analysis (1)
packages/sdk-utilities/src/lib/error/error.utils.ts (1)
packages/sdk-utilities/src/lib/error/index.ts (1)
  • isGenericError (8-8)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: pr
🔇 Additional comments (4)
packages/sdk-effects/storage/src/lib/storage.effects.ts (3)

71-76: LGTM! Defensive error handling for custom storage retrieval.

This try/catch appropriately handles runtime exceptions from custom storage implementations and returns a structured GenericError. The explicit type annotation ensures type safety. This addresses the follow-up task from SDKS-4361 where error handling was missing. Based on learnings, this is a needed fix.


110-115: LGTM! Consistent error handling for custom storage set operation.

The try/catch correctly handles exceptions, and result ?? null properly normalizes undefined returns to null, maintaining consistency with the StorageClient<Value>.set return type signature.


127-132: LGTM! Mirrors the set operation's error handling pattern.

The implementation is consistent with the set method and properly handles exceptions from custom storage implementations.

packages/sdk-utilities/src/lib/error/error.utils.ts (1)

16-25: Type guard correctly validates all required GenericError properties.

The implementation checks both required properties (error and type as strings). GenericError has no additional required properties—only optional ones (code, message, status) which correctly aren't validated by the guard. While the guard could be enhanced to validate that type matches specific string literal values ('argument_error', 'auth_error', etc.), the current implementation is sufficient and follows pragmatic TypeScript type guard patterns.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/sdk-effects/storage/src/lib/storage.effects.ts (1)

78-80: Consider using the isGenericError type guard for consistency.

The PR introduces an isGenericError type guard in @forgerock/sdk-utilities. The current check typeof value === 'object' && 'error' in value could be replaced with the type guard for:

  1. Consistency with other parts of the codebase (davinci-client)
  2. Centralized error type checking logic
  3. Better type narrowing
♻️ Suggested refactor
+import { isGenericError } from '@forgerock/sdk-utilities';
-        if (value === null || (typeof value === 'object' && 'error' in value)) {
+        if (value === null || isGenericError(value)) {
           return value;
         }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3ec032 and 3c63979.

📒 Files selected for processing (5)
  • .changeset/fix-storage-error-handling.md
  • packages/davinci-client/src/lib/client.store.ts
  • packages/sdk-effects/storage/src/lib/storage.effects.ts
  • packages/sdk-utilities/src/lib/error/error.utils.test.ts
  • packages/sdk-utilities/src/lib/error/error.utils.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/sdk-utilities/src/lib/error/error.utils.test.ts
  • packages/davinci-client/src/lib/client.store.ts
  • .changeset/fix-storage-error-handling.md
  • packages/sdk-utilities/src/lib/error/error.utils.ts
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: ancheetah
Repo: ForgeRock/ping-javascript-sdk PR: 417
File: packages/sdk-effects/storage/src/lib/storage.effects.ts:11-12
Timestamp: 2025-09-23T20:50:26.537Z
Learning: When the storage client API was changed from returning void to GenericError | null in SDKS-4361, call sites in DaVinci client and OIDC client were not updated to handle the returned errors, creating a follow-up task for proper error handling implementation.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Mend Code Security Check
  • GitHub Check: pr
🔇 Additional comments (3)
packages/sdk-effects/storage/src/lib/storage.effects.ts (3)

71-76: LGTM! Proper error handling for custom storage retrieval.

This try/catch correctly wraps the custom storage get operation and returns a structured error on failure, aligning with the browser storage error handling pattern. Based on learnings, this addresses the follow-up task from SDKS-4361 for proper error handling implementation.


110-115: LGTM! Robust error handling for custom storage set operation.

The try/catch correctly captures exceptions from the custom storage implementation and returns a structured error. The result ?? null fallback properly handles implementations that may return undefined instead of null.


127-132: LGTM! Consistent error handling for custom storage removal.

The implementation mirrors the set operation pattern and correctly handles exceptions from custom storage implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants