tju-yxq opened a new issue, #2591:
URL: https://github.com/apache/rocketmq-dashboard/issues/2591

   ## Problem
   
   The Audit Log page has two related request-consistency issues.
   
   ### 1. Filtered reads are not sequenced
   
   The page uses a local `cancelled` flag for each effect run:
   
   ```ts
   let cancelled = false;
   ...
   return () => {
     cancelled = true;
   };
   ```
   
   That only prevents updates after the component unmounts or the effect is 
cleaned up. In concurrent filtering, a slow earlier request can still resolve 
after a newer request has started and overwrite the newer result because each 
closure has its own independent `cancelled` flag.
   
   The loading state has a similar weakness:
   
   ```ts
   void Promise.resolve().then(() => {
     if (!cancelled) setLoading(true);
   });
   ```
   
   This delays the loading transition and can race with the cleanup of the same 
effect.
   
   Filter options have the same stale-response problem after cleanup refreshes.
   
   ### 2. Export uses a different search filter than the table
   
   The record query debounces search text before sending it:
   
   ```ts
   search: debouncedSearchText
   ```
   
   But export immediately sends the raw input:
   
   ```ts
   search: searchText
   ```
   
   If the user types a search term and clicks Export before the debounce timer 
fires, the exported file can use a partial keyword while the table is querying 
another value. The user sees one filter but receives an export for another.
   
   ## Expected behavior
   
   - Sequence audit record requests and ignore responses that are no longer 
latest.
   - Sequence filter-option requests, especially after cleanup refreshes.
   - Make loading state track the latest request reliably.
   - Use one active, debounced filter object for both table queries and export.
   - Recover when a filter change returns an empty page but the server total is 
still positive.
   - Do not emit a stale error toast after another request has superseded it.
   
   ## Verification scope
   
   Tests should cover:
   - export waiting for the debounced search value;
   - stale filter-option responses not replacing newer options;
   - loading remaining active while the latest request is pending;
   - existing filter persistence, cleanup, and export behavior remaining 
unchanged.


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

Reply via email to