influxdata / influxdata/docs-v2

Core URL selector falls back to OSS default (localhost:8086) instead of localhost:8181

Open
#7,504 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
82
Forks
326
Avg merge
1d 1h
Merged PRs (30d)
82

Description

## Defect

On an **InfluxDB 3 Core** page, the "What is your InfluxDB 3 Core URL?" selector renders the generic Cloud/OSS-or-Enterprise tabs with a default of **`localhost:8086`** (OSS/v2 host) instead of the Core-specific form defaulting to **`localhost:8181`** with no tabs.

Surfaced on a PR preview (influxdata/docs-v2#7481) and not reproducible in a clean local build (the Core modal correctly shows `localhost:8181`, formID `influxdb-core-url`, zero `pref-tabs`), so it's environment-specific — most likely stale `localStorage['influxdata_docs_urls']` missing the `core` key.

This is a pre-existing characteristic of `assets/js/influxdb-url.js`'s storage design, not something introduced by #7481: `localStorage` is scoped by browser origin, not path, so any setup where multiple PR previews (or repeat visits) share one origin — which was equally true under the old `gh-pages`-based previews (`influxdata.github.io/docs-v2/pr-preview/pr-N/`, one shared origin for every PR) as it is under the new S3-based previews (`test2.docs.influxdata.com/pr-preview/pr-N/`, also one shared origin) — can produce this collision. It's unrelated to #6960 (`undefined` host), which has a different root cause and is already closed.

## Regression test case

1. Visit a Core code-example page (e.g. `/influxdb3/core/admin/query-system-data/`) with **stale storage** seeded in `onBeforeLoad`:
```js
win.localStorage.setItem('influxdata_docs_urls', JSON.stringify({
oss: 'http://localhost:8086',
prev_oss: 'http://localhost:8086',
custom: '',
})); // no core key -- simulates a returning/cross-preview visitor
```
2. Open the URL selector (`.url-trigger`).

**Assert:**
- Modal title is "What is your InfluxDB 3 Core URL?"
- No `#pref-tabs` (`pref-cloud` / `pref-oss`) are present.
- The default/selected URL is `http://localhost:8181`, not `localhost:8086`.
- No code block renders `localhost:8086` or `undefined` as the host.

Repeat with storage cleared entirely to confirm the initialized default is also `localhost:8181`.

## Fix direction

Backfill/normalize the `core` (and `enterprise`) keys in `influxdb-url.js` and resolve the default by page context, so stale or OSS-origin storage can't override the Core default.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with assets/js/influxdb-url.js and the Core code-example page at /influxdb3/core/admin/query-system-data/. Run the regression scenario with stale and cleared localStorage, then inspect the .url-trigger modal. Done means the Core modal has no preference tabs, defaults to http://localhost:8181, and never renders localhost:8086 or undefined.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.