Skip to content

fix(influxdb3): backfill missing product URLs in localStorage#6961

Merged
jstirnaman merged 2 commits intomasterfrom
claude/fix-issue-6960-sepRP
Mar 18, 2026
Merged

fix(influxdb3): backfill missing product URLs in localStorage#6961
jstirnaman merged 2 commits intomasterfrom
claude/fix-issue-6960-sepRP

Conversation

@jstirnaman
Copy link
Contributor

Returning visitors with stale localStorage (created before core/enterprise
products were added) had undefined URL values for new products. The
updateUrls() function then replaced Hugo-rendered hostnames like
localhost:8181 with the string "undefined" in api-endpoint blocks.

Fix by merging DEFAULT_STORAGE_URLS as fallbacks when reading from
localStorage, so new product keys are always present.

closes #6960

https://claude.ai/code/session_01GJZ2yMR5DBk1feqTD5LeHW

Returning visitors with stale localStorage (created before core/enterprise
products were added) had undefined URL values for new products. The
updateUrls() function then replaced Hugo-rendered hostnames like
localhost:8181 with the string "undefined" in api-endpoint blocks.

Fix by merging DEFAULT_STORAGE_URLS as fallbacks when reading from
localStorage, so new product keys are always present.

closes #6960

https://claude.ai/code/session_01GJZ2yMR5DBk1feqTD5LeHW
@jstirnaman jstirnaman requested a review from a team as a code owner March 18, 2026 04:19
@jstirnaman jstirnaman requested review from Copilot and sanderson and removed request for a team March 18, 2026 04:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes an issue where returning visitors with older localStorage URL objects (created before new InfluxDB 3 products were added) could end up with missing product keys, which then propagated undefined into URL replacement logic (notably in API endpoint blocks).

Changes:

  • Backfill missing product URL keys by merging DEFAULT_STORAGE_URLS with stored URL data when reading all URLs.
  • Add a default fallback when reading a single product URL from storage.

You can also share your feedback on Copilot code review. Take the survey.

Adds 2 E2E tests for the fix in #6960:

1. Stale localStorage (missing `core` key) should not cause "undefined"
   to appear in api-endpoint or code blocks on the plugins page.
2. Fresh localStorage should be initialized with all expected product
   URL keys (oss, cloud, core, enterprise, serverless, dedicated, clustered).

Run with:
  node cypress/support/run-e2e-specs.js --spec "cypress/e2e/influxdb-url.cy.js" --no-mapping

https://claude.ai/code/session_01GJZ2yMR5DBk1feqTD5LeHW
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a regression where returning visitors with stale localStorage (missing newly added product URL keys like core/enterprise) could cause InfluxDB URL replacement to substitute rendered hosts with the literal string "undefined" in api-endpoint blocks.

Changes:

  • Merge DEFAULT_STORAGE_URLS into stored URL data when reading from localStorage, ensuring newly introduced product keys always have fallback values.
  • Add Cypress E2E regression tests covering stale localStorage behavior and URL storage initialization.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
assets/js/services/local-storage.js Backfills missing URL keys at read time via merging defaults and adds per-product default fallback in getInfluxDBUrl().
cypress/e2e/influxdb-url.cy.js Adds E2E regression coverage to ensure undefined doesn’t appear in rendered API endpoint/code blocks and that storage initializes with expected keys.

You can also share your feedback on Copilot code review. Take the survey.

@jstirnaman jstirnaman merged commit e1f8358 into master Mar 18, 2026
13 checks passed
@jstirnaman jstirnaman deleted the claude/fix-issue-6960-sepRP branch March 18, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JavaScript returning undefined for the host

3 participants