You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "ai-yang (via GitHub)" <gi...@apache.org> on 2026/08/01 10:30:57 UTC

[I] [Studio][Bug] Stale message requests can restore reset results or overwrite another trace [rocketmq-dashboard]

ai-yang opened a new issue, #734:
URL: https://github.com/apache/rocketmq-dashboard/issues/734

   ## Affected branch
   
   `rocketmq-studio` at `bbf1b7e0cf25a5065ba049b5450cc8155569f710`
   
   ## Problem
   
   The message page applies asynchronous query and trace responses without checking whether the request still owns the corresponding UI state.
   
   This causes two related stale-response paths in `web/src/pages/instance/message.tsx`:
   
   1. `handleReset()` clears the table but does not invalidate an in-flight `queryMessages()` call. A late response repopulates the table after the user reset it.
   2. Closing message A's detail and opening message B starts a second `getMessageTrace()` call, but a late response for A can overwrite B's already displayed trace.
   
   ## Deterministic reproduction
   
   ### Query after reset
   
   1. Make `queryMessages()` return a controlled pending Promise.
   2. Start a query.
   3. Click Reset while the Promise is pending.
   4. Resolve it with a record named `late-after-reset`.
   
   Expected: the table stays empty because Reset invalidated the request.
   
   Actual: `late-after-reset` appears in the table.
   
   ### Trace after switching messages
   
   1. Return messages A and B from the query.
   2. Open A's trace and keep its trace Promise pending.
   3. Close A and open B.
   4. Resolve B's trace, then resolve A's trace.
   
   Expected: B's trace remains displayed.
   
   Actual: A's late trace replaces B's trace while the dialog still belongs to B.
   
   The controlled regression tests are:
   
   ```text
   MessagePage async request ownership > does not restore query results after the user resets an in-flight query
   MessagePage async request ownership > does not display a late trace from a previously closed message detail
   ```
   
   Both business assertions failed in each of 5/5 isolated Vitest processes on the unmodified branch under Node 20.19.5. The tests use controlled Promises only, without timers, fixed sleeps, random scheduling, network access, or external services. This test file was executed separately from the LLM settings regression file so their mocks and component state could not interfere.
   
   ## Impact
   
   Operators can see results that no longer match the current form state or trace data belonging to a different message. That can lead to incorrect troubleshooting conclusions.
   
   The default backend provider currently returns empty stub data as tracked by #684, so the visible production path depends on a real/custom provider or resolution of #684. The frontend state bug is independent of the provider implementation.
   
   ## Suggested fix
   
   - Track a monotonically increasing request generation (or equivalent ownership token) separately for message queries and traces.
   - Invalidate the query generation on Reset and unmount.
   - Invalidate the trace generation when closing the dialog, opening another message, and unmounting.
   - Apply loading, success, error, and `finally` state only when the completing request still owns the current generation.
   - Keep the two controlled-Promise regression tests.
   
   The expected production change is limited to `web/src/pages/instance/message.tsx`, with regression coverage in `web/src/pages/instance/__tests__/MessagePageAsyncState.test.tsx`.
   
   ## Related work checked
   
   - #684 tracks the production `MessageProviderStub` returning empty results; it does not handle frontend request ownership.
   - Merged PR #445 connected the page to the backend APIs, and merged PR #526 added message/trace DTOs. Closed, unmerged PR #530 proposed request DTOs. None adds frontend request ownership.
   - Historical issues #94 and #190 report trace-query failures, not a late response being applied to another open message.
   
   Searches across open and closed issues, plus open/closed/merged pull requests, covered `MessagePage`, `message.tsx`, `queryMessages`, `getMessageTrace`, query Reset, message-detail trace dialogs, late/stale responses, and request races. No equivalent frontend report, fix, or claimed work was found.
   


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Studio][Bug] Stale message requests can restore reset results or overwrite another trace [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed issue #734: [Studio][Bug] Stale message requests can restore reset results or overwrite another trace
URL: https://github.com/apache/rocketmq-dashboard/issues/734


-- 
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: [I] [Studio][Bug] Stale message requests can restore reset results or overwrite another trace [rocketmq-dashboard]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #734:
URL: https://github.com/apache/rocketmq-dashboard/issues/734#issuecomment-5151548136

   **Issue Evaluation**
   
   Category: `bug` | Status: **Needs Verification**
   
   Thank you for reporting this issue. The reported behavior will be verified against the current codebase by our automated analysis pipeline.
   
   A detailed assessment will follow once verification is complete. If you have additional context (version, reproduction steps, logs), please share it to help speed up the process.
   
   ---
   *Automated evaluation by github-manager*


-- 
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: [I] [Studio][Bug] Stale message requests can restore reset results or overwrite another trace [rocketmq-dashboard]

Posted by "ai-yang (via GitHub)" <gi...@apache.org>.
ai-yang commented on issue #734:
URL: https://github.com/apache/rocketmq-dashboard/issues/734#issuecomment-5159076879

   Additional verification evidence is available in PR #735:
   
   - On `rocketmq-studio` at `bbf1b7e0cf25a5065ba049b5450cc8155569f710`, both deterministic stale-query/trace assertions failed in 5/5 isolated Node 20.19.5 processes.
   - With the fix, 20 isolated processes passed 6/6 tests each (120/120), and the full frontend suite passed 271/271.
   - ESLint reported 0 errors, the TypeScript/Vite build passed, and all three PR CI jobs succeeded.
   
   The change does not alter the message API contract.
   


-- 
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: [I] [Studio][Bug] Stale message requests can restore reset results or overwrite another trace [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on issue #734:
URL: https://github.com/apache/rocketmq-dashboard/issues/734#issuecomment-5161946247

   Resolved by #735 (merged into rocketmq-studio as 93d9193).


-- 
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