Skip to content

fix(web): prevent home page reload loop in Mock mode - #2020

Closed
123123213weqw wants to merge 1 commit into
apache:rocketmq-studiofrom
123123213weqw:pr/fix-home-mock-reload-loop
Closed

fix(web): prevent home page reload loop in Mock mode#2020
123123213weqw wants to merge 1 commit into
apache:rocketmq-studiofrom
123123213weqw:pr/fix-home-mock-reload-loop

Conversation

@123123213weqw

Copy link
Copy Markdown

What is the purpose of the change

Fix #2017.

When the runtime data-mode toggle is set to Mock, the Studio home page still requested GET /api/llm/config during mount. A local backend without a valid authenticated session responded with 401, the global Axios interceptor redirected to '/' and the page reloaded into the same request, producing a visible reload loop.

Brief changelog

  • HomePage: skip the LLM config fetch in Mock mode and render the default model list directly
  • added a regression test asserting getLlmConfig is not called in Mock mode

How was this patch verified

  • npx vitest run src/pages/home/tests/HomePage.test.tsx (3 passed)
  • npx tsc -b clean
  • npx eslint . clean

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

Fixes home page reload loop in Mock mode by preventing unnecessary re-renders when LLM config is not available. Clean fix for a specific edge case.

Verdict: Good bug fix. LGTM.


Automated review by github-manager-bot

lizhimins pushed a commit to 123123213weqw/rocketmq-dashboard that referenced this pull request Aug 13, 2026
Consolidates 16 frontend UX PRs by 123123213weqw (apache#1563, apache#1624, apache#1732,
apache#1743, apache#1747-apache#1750, apache#1852-apache#1853, apache#1883, apache#2020-apache#2024): DLQ resend request-id
guard, best-effort proxy address persistence, locale-independent navigation
search, preserve selected home prompt mode, normalize alert levels before
filtering, restore audit refresh loading state, bound AI SSE event buffers,
format blank dates as unavailable, hook mocks for instance changes and
topic-scoped traces, keep 401 errors for malformed request URLs, prevent
Mock-mode home reload loop, surface Message Explorer topic load failures,
refresh alerts after clearing acknowledged records, gate data source
mutations until the initial list is ready, ignore stale NameServer drift
bootstrap results.
lizhimins pushed a commit that referenced this pull request Aug 13, 2026
…1563)

* fix(web): migrate deprecated Ant Design props across Studio pages

Consolidates 17 per-page migration PRs by 123123213weqw: message (#1835),
certificate (#1836), client (#1837), cluster (#1838), ACL (#1839),
consumer (#1840), DLQ (#1841), instance (#1842), topic (#1843),
alert rule (#1844), settings modal (#1845), alert asset modal (#1846),
group management (#1847), LiteTopic (#1848), producer (#1849),
proxy (#1850), SSL settings (#1851). Behavior unchanged.

* fix(server): harden validation, normalization and null-safety

Consolidates 40 backend robustness PRs by 123123213weqw (#1114,
#1733-#1735, #1737-#1739, #1742, #1744-#1745, #1854-#1882, #1884):
block new admin connections during shutdown, Locale.ROOT normalization
for LLM engines and agent providers, reject null or malformed persisted
JSON, clamp cloud catalog counts and retry values, skip null catalog,
trace and connection entries, report lost concurrent updates for alert
rules, ACL rules, credentials, instances and certificates, normalize
stored enum values, validate alert identifiers and stored auth modes.

* fix(web): guard stale responses and race conditions in Studio pages

Consolidates 16 frontend UX PRs by 123123213weqw (#1563, #1624, #1732,
#1743, #1747-#1750, #1852-#1853, #1883, #2020-#2024): DLQ resend request-id
guard, best-effort proxy address persistence, locale-independent navigation
search, preserve selected home prompt mode, normalize alert levels before
filtering, restore audit refresh loading state, bound AI SSE event buffers,
format blank dates as unavailable, hook mocks for instance changes and
topic-scoped traces, keep 401 errors for malformed request URLs, prevent
Mock-mode home reload loop, surface Message Explorer topic load failures,
refresh alerts after clearing acknowledged records, gate data source
mutations until the initial list is ready, ignore stale NameServer drift
bootstrap results.
lizhimins pushed a commit that referenced this pull request Aug 13, 2026
* fix(web): migrate deprecated Ant Design props across Studio pages

Consolidates 17 per-page migration PRs by 123123213weqw: message (#1835),
certificate (#1836), client (#1837), cluster (#1838), ACL (#1839),
consumer (#1840), DLQ (#1841), instance (#1842), topic (#1843),
alert rule (#1844), settings modal (#1845), alert asset modal (#1846),
group management (#1847), LiteTopic (#1848), producer (#1849),
proxy (#1850), SSL settings (#1851). Behavior unchanged.

* fix(server): harden validation, normalization and null-safety

Consolidates 40 backend robustness PRs by 123123213weqw (#1114,
#1733-#1735, #1737-#1739, #1742, #1744-#1745, #1854-#1882, #1884):
block new admin connections during shutdown, Locale.ROOT normalization
for LLM engines and agent providers, reject null or malformed persisted
JSON, clamp cloud catalog counts and retry values, skip null catalog,
trace and connection entries, report lost concurrent updates for alert
rules, ACL rules, credentials, instances and certificates, normalize
stored enum values, validate alert identifiers and stored auth modes.

* fix(web): guard stale responses and race conditions in Studio pages

Consolidates 16 frontend UX PRs by 123123213weqw (#1563, #1624, #1732,
#1743, #1747-#1750, #1852-#1853, #1883, #2020-#2024): DLQ resend request-id
guard, best-effort proxy address persistence, locale-independent navigation
search, preserve selected home prompt mode, normalize alert levels before
filtering, restore audit refresh loading state, bound AI SSE event buffers,
format blank dates as unavailable, hook mocks for instance changes and
topic-scoped traces, keep 401 errors for malformed request URLs, prevent
Mock-mode home reload loop, surface Message Explorer topic load failures,
refresh alerts after clearing acknowledged records, gate data source
mutations until the initial list is ready, ignore stale NameServer drift
bootstrap results.

* fix(server): correct Aliyun and Tencent OpenAPI parsing

Consolidates 3 cloud-vendor PRs by 123123213weqw (#1978-#1980): map
in-flight Tencent consume trace nodes to process instead of failed, parse
Aliyun OpenAPI timestamps as UTC+8 regardless of server zone, reuse the
TaskRequestId returned by the previous Tencent message query page.
@lizhimins

Copy link
Copy Markdown
Member

Consolidated into #1563 as part of the batch consolidation of @123123213weqw's open PRs (merged into the rocketmq-studio branch), so closing this one. The change is preserved in the merged commit; please direct any follow-ups there.

@lizhimins lizhimins closed this Aug 13, 2026
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.

3 participants