fix(influxdb3): backfill missing product URLs in localStorage#6961
fix(influxdb3): backfill missing product URLs in localStorage#6961jstirnaman merged 2 commits intomasterfrom
Conversation
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
There was a problem hiding this comment.
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_URLSwith 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
There was a problem hiding this comment.
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_URLSinto stored URL data when reading fromlocalStorage, ensuring newly introduced product keys always have fallback values. - Add Cypress E2E regression tests covering stale
localStoragebehavior 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.
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