Kris20030907 opened a new pull request, #7050:
URL: https://github.com/apache/rocketmq-dashboard/pull/7050

   Closes #7049
   
   ## Solution
   
   `clearRuntimeSessionId` now stamps `gmt_modified` explicitly from the 
caller's
   clock — the same convention the alert mappers use (`@Param("now") 
LocalDateTime
   now`): repositories take the time, they do not read it themselves.
   
   ```java
   conversationMapper.update(null, new UpdateWrapper<RmqAiConversation>()
           .eq("id", id)
           .set("runtime_session_id", null)
           .set("gmt_modified", now));
   ```
   
   `AiRunExecutor.forgetRuntimeSession` passes `LocalDateTime.now(clock)`, the 
same
   service clock `rememberRuntimeSession` stamps with. The DDL's
   `ON UPDATE CURRENT_TIMESTAMP` never gets a chance to rewrite the column in 
the
   database session's timezone, so the list ordering
   (`gmt_modified desc, id`) sees one clock again.
   
   A schema-level alternative — dropping `ON UPDATE CURRENT_TIMESTAMP` — was
   considered and rejected: it needs a migration for existing installs, and 
every
   other write site already stamps the column explicitly.
   
   ## Tests
   
   - 
`AiTimelineRepositoryTest.forgettingTheRuntimeSessionShouldStampGmtModifiedFromTheCallerClockTest`:
     the captured `UpdateWrapper` must carry `gmt_modified` bound to the 
caller's
     timestamp. Red before the fix.
   - The existing forget-session tests keep asserting the clear itself
     (`runtime_session_id` named and bound to null); `AiRunExecutorTest`'s two
     verifications follow the new signature.
   
   ## Verification
   
   Full server suite: 3736 tests pass. Frontend suites: not affected 
(server-only
   change).
   


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