Skip to content

Conversation

@ryanbas21
Copy link
Collaborator

@ryanbas21 ryanbas21 commented Jan 22, 2026

JIRA Ticket

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

Description

Add support for well known endpoint

Summary by CodeRabbit

  • New Features

    • OIDC well-known endpoint support for automatic configuration discovery, with realm inference and URL validation.
    • Standardized error handling for well-known fetch failures and new convenience selector helpers exposed.
  • Tests

    • Added comprehensive tests for well-known utilities, discovery, and error handling.
  • Chores

    • Expanded public exports to surface the well-known utilities and selectors.

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

@changeset-bot
Copy link

changeset-bot bot commented Jan 22, 2026

🦋 Changeset detected

Latest commit: 03b785b

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

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

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 22, 2026

📝 Walkthrough

Walkthrough

Adds OIDC well-known endpoint discovery: new types, utilities, RTK Query API, error helpers, tests, and wiring into journey-client, oidc effects, and shared utilities; journey initialization can now resolve async well-known configuration or use standard normalization.

Changes

Cohort / File(s) Summary
Config type additions
packages/journey-client/src/lib/config.types.ts
Adds WellknownServerConfig, AsyncJourneyClientConfig, InternalJourneyClientConfig, and JourneyConfigInput to represent standard vs. async well-known config shapes.
Journey client store / resolution
packages/journey-client/src/lib/client.store.ts, packages/journey-client/src/lib/client.store.utils.ts, packages/journey-client/src/lib/journey.slice.ts
Introduces resolveAsyncConfig, routes journey initialization to fetch/merge well-known data when present, updates store wiring to accept InternalJourneyClientConfig, and registers wellknownApi reducer/middleware.
Well-known API re-exports & selectors
packages/journey-client/src/lib/wellknown.api.ts, packages/oidc-client/src/lib/wellknown.api.ts, packages/sdk-effects/oidc/src/lib/wellknown.api.ts
Re-exports wellknownApi and createWellknownSelector from @forgerock/sdk-oidc; adds local selector helper in oidc-client and a new RTK Query API implementation in sdk-effects/oidc.
Well-known utilities & error handling
packages/journey-client/src/lib/wellknown.utils.ts, packages/sdk-effects/oidc/src/lib/wellknown.utils.ts, packages/sdk-utilities/src/lib/wellknown/wellknown.utils.ts
Adds hasWellknownConfig type guard; re-exports createWellknownError, inferRealmFromIssuer, isValidWellknownUrl; implements createWellknownError logic and utilities to infer realm and validate URLs.
Tests for well-known logic
packages/journey-client/src/lib/wellknown.utils.test.ts, packages/sdk-effects/oidc/src/lib/wellknown.utils.test.ts, packages/sdk-utilities/src/lib/wellknown/wellknown.utils.test.ts
New Vitest suites covering hasWellknownConfig behavior, createWellknownError variations, inferRealmFromIssuer, and isValidWellknownUrl edge cases.
Public re-exports & packaging
packages/journey-client/src/types.ts, packages/sdk-effects/oidc/src/index.ts, packages/sdk-utilities/src/index.ts, packages/sdk-utilities/src/lib/wellknown/index.ts, packages/journey-client/package.json, packages/journey-client/tsconfig*.json
Exposes well-known helpers via public entrypoints, adds dependency @forgerock/sdk-oidc, and updates TS project references to include sdk-effects/oidc.
DaVinci client adjustments
packages/davinci-client/src/lib/client.store.ts, packages/davinci-client/src/lib/wellknown.api.ts, packages/davinci-client/src/lib/wellknown.types.ts, packages/davinci-client/src/lib/config.types.ts, packages/davinci-client/src/lib/config.types.test-d.ts
Replaces local well-known RTK setup with re-exports from @forgerock/sdk-oidc, renames WellknownResponseWellKnownResponse, adds createWellknownError usage and consolidates types.
Misc / changeset
.changeset/rich-cows-try.md
Adds a changeset declaring a minor release for @forgerock/journey-client describing well-known endpoint support.

Sequence Diagram

sequenceDiagram
    participant App as App
    participant JourneyFactory as Journey Factory
    participant ConfigResolver as Config Resolver
    participant WellknownAPI as Wellknown API
    participant Redux as Redux Store
    participant JourneyStore as Journey Store

    rect rgba(100,150,200,0.5)
    Note over App,JourneyStore: Well-known Configuration Path
    App->>JourneyFactory: journey(JourneyConfigInput with wellknown URL)
    JourneyFactory->>ConfigResolver: hasWellknownConfig(config)?
    ConfigResolver-->>JourneyFactory: true
    JourneyFactory->>ConfigResolver: resolveAsyncConfig(config)
    ConfigResolver->>WellknownAPI: Fetch well-known configuration
    WellknownAPI->>Redux: Cache result
    WellknownAPI-->>ConfigResolver: WellKnownResponse
    ConfigResolver->>ConfigResolver: inferRealmFromIssuer(issuer)
    ConfigResolver->>ConfigResolver: Merge configurations
    ConfigResolver-->>JourneyFactory: InternalJourneyClientConfig
    end

    rect rgba(150,100,200,0.5)
    Note over App,JourneyStore: Standard Configuration Path
    App->>JourneyFactory: journey(JourneyConfigInput)
    JourneyFactory->>ConfigResolver: hasWellknownConfig(config)?
    ConfigResolver-->>JourneyFactory: false
    JourneyFactory->>ConfigResolver: normalizeConfig(config)
    ConfigResolver-->>JourneyFactory: InternalJourneyClientConfig
    end

    JourneyFactory->>JourneyStore: createJourneyStore(resolvedConfig)
    JourneyStore->>Redux: Register API, reducer, middleware
    Redux-->>JourneyStore: Store created
    JourneyStore-->>App: Store ready
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • #431 — Modifies client.store.ts and the config normalization flow; overlaps with journey initialization and normalizeConfig changes.
  • #345 — Aggregated release changes that include well-known discovery wiring, APIs, and types used here.

Suggested reviewers

  • cerebrl
  • ancheetah

"I'm a rabbit with a patch to share,
I sniffed a well-known URL in the air,
I fetched the realms and knitted the store,
Redux hums and configs pour,
Hop, hop—async discovery everywhere! 🐇"

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description includes a JIRA ticket reference and basic description, but lacks detailed context about the implementation, testing, and changeset declaration. Expand description with implementation details, testing approach, and confirm changeset file was added as documented in the raw summary.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding well-known endpoint configuration support to the journey-client package.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Jan 22, 2026

View your CI Pipeline Execution ↗ for commit 03b785b

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

☁️ Nx Cloud last updated this comment at 2026-01-26 20:24:50 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 22, 2026

Open in StackBlitz

@forgerock/davinci-client

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

@forgerock/device-client

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

@forgerock/journey-client

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

@forgerock/oidc-client

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

@forgerock/protect

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

@forgerock/sdk-types

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

@forgerock/sdk-utilities

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

@forgerock/iframe-manager

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

@forgerock/sdk-logger

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

@forgerock/sdk-oidc

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

@forgerock/sdk-request-middleware

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

@forgerock/storage

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

commit: 03b785b

@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 71.07692% with 94 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.36%. Comparing base (b89ad58) to head (03b785b).
⚠️ Report is 33 commits behind head on main.

Files with missing lines Patch % Lines
packages/journey-client/src/lib/client.store.ts 57.72% 52 Missing ⚠️
packages/sdk-effects/oidc/src/lib/wellknown.api.ts 4.34% 22 Missing ⚠️
packages/journey-client/src/types.ts 0.00% 8 Missing ⚠️
packages/davinci-client/src/lib/client.store.ts 0.00% 7 Missing ⚠️
packages/sdk-effects/oidc/src/index.ts 0.00% 2 Missing ⚠️
packages/davinci-client/src/lib/wellknown.api.ts 0.00% 1 Missing ⚠️
packages/sdk-utilities/src/index.ts 0.00% 1 Missing ⚠️
packages/sdk-utilities/src/lib/wellknown/index.ts 50.00% 1 Missing ⚠️

❌ Your project status has failed because the head coverage (19.36%) 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     #525      +/-   ##
==========================================
+ Coverage   18.79%   19.36%   +0.57%     
==========================================
  Files         140      148       +8     
  Lines       27640    28005     +365     
  Branches      980     1028      +48     
==========================================
+ Hits         5195     5424     +229     
- Misses      22445    22581     +136     
Files with missing lines Coverage Δ
packages/davinci-client/src/lib/config.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/wellknown.types.ts 100.00% <ø> (ø)
...kages/journey-client/src/lib/client.store.utils.ts 100.00% <100.00%> (ø)
packages/journey-client/src/lib/journey.slice.ts 100.00% <100.00%> (ø)
packages/journey-client/src/lib/wellknown.api.ts 100.00% <100.00%> (ø)
packages/journey-client/src/lib/wellknown.utils.ts 100.00% <100.00%> (ø)
packages/oidc-client/src/lib/wellknown.api.ts 100.00% <100.00%> (ø)
...ckages/sdk-effects/oidc/src/lib/wellknown.utils.ts 100.00% <100.00%> (ø)
...sdk-utilities/src/lib/wellknown/wellknown.utils.ts 100.00% <100.00%> (ø)
packages/davinci-client/src/lib/wellknown.api.ts 50.00% <0.00%> (+43.75%) ⬆️
... and 7 more

... and 2 files with indirect coverage changes

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2026

Deployed 80cb7fe to https://ForgeRock.github.io/ping-javascript-sdk/pr-525/80cb7fea481099a2ae8aafb104b509b9398b29a8 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2026

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔺 @forgerock/sdk-utilities - 10.7 KB (+2.2 KB, +25.6%)
🔻 @forgerock/journey-client - 0.0 KB (-82.5 KB, -100.0%)
🔺 @forgerock/journey-client - 87.1 KB (+4.5 KB, +5.5%)
🔺 @forgerock/sdk-oidc - 7.2 KB (+4.7 KB, +183.5%)

📊 Minor Changes

📈 @forgerock/oidc-client - 23.8 KB (+0.3 KB)
📈 @forgerock/davinci-client - 39.9 KB (+0.1 KB)

➖ No Changes

@forgerock/device-client - 9.2 KB
@forgerock/protect - 150.1 KB
@forgerock/sdk-types - 8.0 KB
@forgerock/storage - 1.5 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/iframe-manager - 2.4 KB
@forgerock/sdk-request-middleware - 4.5 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

@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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/journey-client/src/lib/client.store.ts (1)

68-179: Apply request middleware to well-known discovery.
The discovery call is made via a temp store that doesn’t include requestMiddleware, so any custom headers/auth/fetch logic won’t apply to the well-known request. That can break environments that rely on middleware.

🔧 Proposed fix
 async function resolveAsyncConfig(
   config: JourneyConfigInput & { serverConfig: { wellknown: string } },
   log: ReturnType<typeof loggerFn>,
+  requestMiddleware?: RequestMiddleware[],
 ): Promise<InternalJourneyClientConfig> {
@@
-  const tempStore = createJourneyStore({ config: tempConfig, logger: log });
+  const tempStore = createJourneyStore({ config: tempConfig, logger: log, requestMiddleware });
@@
-    resolvedConfig = await resolveAsyncConfig(config, log);
+    resolvedConfig = await resolveAsyncConfig(config, log, requestMiddleware);
🤖 Fix all issues with AI agents
In `@packages/sdk-effects/oidc/package.json`:
- Line 31: Replace the explicit version for the dependency key
"@reduxjs/toolkit" in package.json (currently "^2.8.0") with the monorepo
catalog spec so it follows the workspace pattern — set the version to
"catalog:^2.8.2" (i.e., change the value for "@reduxjs/toolkit" to
"catalog:^2.8.2") so the package uses the single source of truth defined in
pnpm-workspace.yaml.
🧹 Nitpick comments (4)
packages/sdk-utilities/src/lib/wellknown/wellknown.utils.ts (1)

85-98: Consider adding IPv6 localhost support.

The function allows HTTP for localhost and 127.0.0.1, but not for ::1 (IPv6 localhost) or [::1]. This is a minor edge case but could cause unexpected behavior in IPv6-only development environments.

♻️ Optional: Add IPv6 localhost support
     // Allow HTTP only for localhost (development)
-    const isLocalhost = url.hostname === 'localhost' || url.hostname === '127.0.0.1';
+    const isLocalhost =
+      url.hostname === 'localhost' ||
+      url.hostname === '127.0.0.1' ||
+      url.hostname === '[::1]' ||
+      url.hostname === '::1';
     const isSecure = url.protocol === 'https:';
     const isHttpLocalhost = url.protocol === 'http:' && isLocalhost;
packages/oidc-client/src/lib/wellknown.api.ts (2)

33-38: Selector created on every call defeats memoization.

createSelector is invoked inside the function body, creating a new memoized selector on each call to wellknownSelector. This negates the memoization benefits since each call produces a fresh selector instance.

Consider creating the selector once per wellknownUrl or using createWellknownSelector from the re-exported utilities if it handles this pattern.

♻️ Option: Cache selectors by URL
+const selectorCache = new Map<string, ReturnType<typeof createSelector>>();
+
 export function wellknownSelector(wellknownUrl: string, state: RootState) {
-  const selector = createSelector(
-    wellknownApi.endpoints.configuration.select(wellknownUrl),
-    (result) => result?.data,
-  );
+  let selector = selectorCache.get(wellknownUrl);
+  if (!selector) {
+    selector = createSelector(
+      wellknownApi.endpoints.configuration.select(wellknownUrl),
+      (result) => result?.data,
+    );
+    selectorCache.set(wellknownUrl, selector);
+  }
   return selector(state);
 }

Alternatively, if createWellknownSelector (already exported) provides this functionality, consider using it directly instead of this wrapper.


18-21: Consider combining export and import statements.

The separate re-export (line 18) and import (line 21) from the same package can be consolidated.

♻️ Suggested consolidation
-export { wellknownApi, createWellknownSelector } from '@forgerock/sdk-oidc';
-
-// Import locally for use in selector below
-import { wellknownApi } from '@forgerock/sdk-oidc';
+import { wellknownApi, createWellknownSelector } from '@forgerock/sdk-oidc';
+
+export { wellknownApi, createWellknownSelector };
packages/journey-client/src/lib/wellknown.utils.test.ts (1)

64-69: Consider adding a comment explaining intentional type casts.

The type assertions (as AsyncJourneyClientConfig, as JourneyClientConfig) are used to bypass TypeScript's checks and test edge cases with invalid inputs. A brief comment would clarify this intent for future maintainers.

         const config: JourneyConfigInput = {
           serverConfig: {
             baseUrl: 'https://am.example.com/am/',
             wellknown: '',
           },
-        } as AsyncJourneyClientConfig;
+        } as AsyncJourneyClientConfig; // Intentionally cast to test runtime behavior with empty wellknown

"@forgerock/sdk-types": "workspace:*",
"@forgerock/sdk-utilities": "workspace:*"
"@forgerock/sdk-utilities": "workspace:*",
"@reduxjs/toolkit": "^2.8.0"
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Search for journey-client package.json to verify the RTK dependency pattern
find . -type f -name "package.json" -path "*/journey-client/package.json" | head -5

Repository: ForgeRock/ping-javascript-sdk

Length of output: 111


🏁 Script executed:

# Also search more broadly for journey-client
find . -type d -name "journey-client" | head -5

Repository: ForgeRock/ping-javascript-sdk

Length of output: 98


🏁 Script executed:

# Look for pnpm-workspace or catalog configuration files
fd -e "yaml" -e "yml" -e "json" | grep -E "(workspace|catalog|pnpm)" | head -20

Repository: ForgeRock/ping-javascript-sdk

Length of output: 107


🏁 Script executed:

# Search for `@reduxjs/toolkit` references in package.json files to understand the pattern used
rg -t json "@reduxjs/toolkit" --max-count 10

Repository: ForgeRock/ping-javascript-sdk

Length of output: 523


🏁 Script executed:

# Check pnpm-workspace.yaml to see the catalog setup
cat pnpm-workspace.yaml

Repository: ForgeRock/ping-javascript-sdk

Length of output: 685


🌐 Web query:

@reduxjs/toolkit latest stable version npm registry

💡 Result:

Latest stable version of @reduxjs/toolkit on the npm registry: 2.11.2. [1]


Use catalog: for consistency with the monorepo pattern.

All other packages in the monorepo reference @reduxjs/toolkit via the catalog pattern (defined in pnpm-workspace.yaml as ^2.8.2), but this package uses an explicit version ^2.8.0. This breaks the single source of truth for dependency management and keeps the version outdated. Align with the established monorepo pattern:

-    "@reduxjs/toolkit": "^2.8.0"
+    "@reduxjs/toolkit": "catalog:"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"@reduxjs/toolkit": "^2.8.0"
"@reduxjs/toolkit": "catalog:"
🤖 Prompt for AI Agents
In `@packages/sdk-effects/oidc/package.json` at line 31, Replace the explicit
version for the dependency key "@reduxjs/toolkit" in package.json (currently
"^2.8.0") with the monorepo catalog spec so it follows the workspace pattern —
set the version to "catalog:^2.8.2" (i.e., change the value for
"@reduxjs/toolkit" to "catalog:^2.8.2") so the package uses the single source of
truth defined in pnpm-workspace.yaml.

Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

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

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud is proposing a fix for your failed CI:

These changes fix the e2e test failure by replacing RTK Query with native fetch API in the wellknown configuration resolution. The original implementation created a temporary Redux store to fetch wellknown config, but RTK Query APIs are singletons with global middleware that caused conflicts when multiple journey client instances were created (e.g., after logout). By using fetch directly, we eliminate the store singleton issues while maintaining the wellknown endpoint discovery functionality.

Tip

We verified this fix by re-running @forgerock/journey-suites:e2e-ci--src/protect.test.ts.

Suggested Fix changes
diff --git a/packages/journey-client/src/lib/client.store.ts b/packages/journey-client/src/lib/client.store.ts
index 35c130bd..d7f3ac61 100644
--- a/packages/journey-client/src/lib/client.store.ts
+++ b/packages/journey-client/src/lib/client.store.ts
@@ -17,7 +17,6 @@ import { journeyApi } from './journey.api.js';
 import { setConfig } from './journey.slice.js';
 import { createStorage } from '@forgerock/storage';
 import { createJourneyObject } from './journey.utils.js';
-import { wellknownApi } from './wellknown.api.js';
 import {
   hasWellknownConfig,
   inferRealmFromIssuer,
@@ -80,19 +79,22 @@ async function resolveAsyncConfig(
     throw error;
   }
 
-  // Create a temporary store to fetch well-known (we need the RTK Query infrastructure)
-  const tempConfig: InternalJourneyClientConfig = {
-    serverConfig: { baseUrl: baseUrl || '', paths, timeout },
-    realmPath: config.realmPath,
-  };
-  const tempStore = createJourneyStore({ config: tempConfig, logger: log });
-
-  // Fetch the well-known configuration
-  const { data: wellknownResponse, error: fetchError } = await tempStore.dispatch(
-    wellknownApi.endpoints.configuration.initiate(wellknown),
-  );
+  // Fetch the well-known configuration directly using fetch API
+  // We avoid using RTK Query here to prevent store singleton issues
+  let wellknownResponse: any;
+  try {
+    const response = await fetch(wellknown, {
+      headers: {
+        Accept: 'application/json',
+      },
+    });
+
+    if (!response.ok) {
+      throw new Error(`HTTP ${response.status}: ${response.statusText}`);
+    }
 
-  if (fetchError || !wellknownResponse) {
+    wellknownResponse = await response.json();
+  } catch (fetchError: any) {
     const genericError = createWellknownError(fetchError);
     log.error(`${genericError.error}: ${genericError.message}`);
     throw new Error(genericError.message);

Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally o3Fs-SUDD

Apply fix locally with your editor ↗   View interactive diff ↗


🎓 Learn more about Self-Healing CI on nx.dev

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.

3 participants