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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
