You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "unbridled-41 (via GitHub)" <gi...@apache.org> on 2026/09/06 08:03:38 UTC
[PR] feat(consumer): offer a skip-accumulation preset when resetting offsets [rocketmq-dashboard]
unbridled-41 opened a new pull request, #3994:
URL: https://github.com/apache/rocketmq-dashboard/pull/3994
Related to #3993.
## Problem / Evidence
The classic dashboard (previous generation in this repository, `master` branch) ships a dedicated **skip accumulation** action: `POST /consumer/skipAccumulate.do` (`ConsumerController.java:80`) wired through `frontend-new/src/components/topic/SkipMessageAccumulateDialog.jsx`, which resets the selected group's offsets for a topic to the latest position (`resetTime: -1` in `topic.jsx`'s `handleSkipMessageAccumulate`) so the group stops replaying a stale backlog.
Studio's consumer offset reset modal (`web/src/pages/instance/consumer.tsx`) has no equivalent shortcut: its quick presets are all backward-looking (1/3/6/12 hours ago, 1/3 days ago), so jumping to the latest offsets requires the operator to hand-pick the current time in the time picker — an error-prone step during an incident, and the reason the classic console dedicated an action to it.
## What was added
- A **跳过积压(重置到最新)** preset button in the reset modal's quick-select row that sets the reset timestamp to `now`.
- It clears any stale preview exactly like the other presets, and the existing preview-and-confirm flow still gates the reset: the operator sees the projected per-queue impact (replay/forward counts and risk levels) before applying.
- No backend change: Studio's reset/preview path already resolves a timestamp to per-queue offsets via `searchOffset` and clamps to `[minOffset, maxOffset]`, so a current timestamp produces the classic skip-to-latest behavior with better visibility than the classic dialog.
## Priority & scoring
FEATURE_PRIORITY = 项目需求 28 + 外部实现成熟度 24 + 项目契合度 17 + 可测试性 9 = **78**. The parent dashboard ships the action (external maturity, cited above), the fit is a small extension of an existing modal with the safety preview kept (fit), and the behavior is deterministic and UI-testable (testability). IMPLEMENTATION_CONFIDENCE: 88 — one preset button following the established preset pattern; no API or backend change.
## Tests (actual commands and results)
- New test `supports skipping accumulation by resetting to the latest offsets` (`web/src/pages/instance/__tests__/ConsumerPage.test.tsx`): selects a topic, clicks the preset, re-previews, and asserts the preview request's timestamp falls in the [before-click, now] window (i.e. the preset sends "now", not the default "3 hours ago"), and the preview/confirm flow stays intact.
- Red (implementation stashed, test kept): `npx vitest run src/pages/instance/__tests__/ConsumerPage.test.tsx -t "skipping accumulation"` → `TestingLibraryElementError: Unable to find an accessible element with the role "button" and name /跳过积压/`.
- Green: `npx vitest run src/pages/instance/__tests__/ConsumerPage.test.tsx` → **30 passed (30)**; full web suite `npx vitest run` → **923 tests, 1 failed** — the pre-existing load-fragile `shows group health diagnostics` case in this file (passes in isolation; the documented full-suite fragility of this sandbox, unrelated to this change; 923 = 922 baseline + 1 new test).
- `npx tsc -b` clean; `eslint` clean on both changed files; `npm run build` succeeds.
## Compatibility & Risk
- Frontend-only, 2 files (+39 lines): one button in the modal and one test. No API, contract, i18n-key, or dependency changes; the page already uses hardcoded zh labels in this modal, so the label follows local style.
- Risk is the same as any reset operation and is unchanged: the preview-and-confirm gating (including failed-queue blocking) applies to the preset exactly as to manual timestamps. The preset only pre-fills a timestamp; it never applies anything by itself.
- Differences from the classic implementation: the classic dialog batch-reset multiple groups for a topic without a preview; Studio intentionally resets one group per modal behind a risk preview, so this PR restores the intent (one-click skip-to-latest) within Studio's existing safety model rather than porting the batch+force behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(consumer): offer a skip-accumulation preset when resetting offsets [rocketmq-dashboard]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #3994:
URL: https://github.com/apache/rocketmq-dashboard/pull/3994#issuecomment-5557910365
## Verification evidence
- **CI**: head `2215c53ecb611dd3bf78718f9f1d22106b5d2e4b` has 0 check runs and no workflow runs (verified via `commits/{sha}/check-runs` and `actions/runs?head_sha`); upstream CI currently fails to start for all branches, so results come from local execution.
- **Red (before the fix)**: implementation stashed, test kept — `npx vitest run src/pages/instance/__tests__/ConsumerPage.test.tsx -t "skipping accumulation"` → `TestingLibraryElementError: Unable to find an accessible element with the role "button" and name /跳过积压/` (1 failed, 29 skipped).
- **Module tests**: `npx vitest run src/pages/instance/__tests__/ConsumerPage.test.tsx` → **30 passed (30)** including the new test (also verified stable across repeated runs).
- **Full suite + baseline**: `npx vitest run` → **923 tests, 1 failed** — the pre-existing load-fragile `shows group health diagnostics from subscriptions, progress and clients` case in the same file, which passes in isolation; this matches the pristine baseline (36126024) behavior documented for the full web suite in this sandbox. 923 = 922 baseline + 1 new test; zero new failures.
- **Build**: `npm run build` succeeds (vite ✓); `npx tsc -b` clean; `eslint` clean on both changed files.
- **Diff self-check**: 2 files, +39/−0 — one quick-select button in `consumer.tsx` and one test in `ConsumerPage.test.tsx`. No backend, API, dependency, or unrelated changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(consumer): offer a skip-accumulation preset when resetting offsets [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #3994:
URL: https://github.com/apache/rocketmq-dashboard/pull/3994
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org