prosgarz35 commented on PR #3198:
URL: https://github.com/apache/james-project/pull/3198#issuecomment-5809172944

       1. **Mock-free testing & higher-level tests**:
          Fully agree with the testing philosophy. The heavy mock-based 
`IdleProcessorTest` has been removed. All core lifecycle and protocol 
interactions (valid DONE, malformed continuations, mid-idle LOGOUT, client 
disconnects, Netty
     frame ordering) are covered end-to-end via real socket tests in 
`IMAPServerIdleTest`.
       2. **Extract parsing / sanitization**:
          Extracted the continuation display sanitization into a 
package-private static helper `sanitizeForDisplay(line)` with dedicated, 
mock-free unit tests in `IdleProcessorSanitizationTest`.
       3. **Regex-free implementation**:
          Replaced regex pattern matching with a fast linear character 
iteration without regex compilation or excessive string allocations.
       4. **Variable naming**:
          Renamed `sm` to `selectedMailbox` throughout `IdleProcessor`.
       5. **Ordering of `pushLineHandler` vs `respond`**:
          `session.pushLineHandler(...)` is invoked synchronously on the 
connection pipeline before `responder.respond(new ContinuationResponse(...))` 
and `responder.flush()`. Because `pushLineHandler` immediately prepends the 
handler to
     `behaviourOverrides` in `ImapRequestFrameDecoder` within Netty, the line 
handler is already active and ready before `+ Idling` leaves the socket.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to