-
Notifications
You must be signed in to change notification settings - Fork 3
Improve WebSocketPushSender with checkDesktop() to validate ws session and auto reconnect #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Mario Serrano <[email protected]>
…dd session check Signed-off-by: Mario Serrano <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves the WebSocketPushSender class by adding a new checkDesktop() method to validate WebSocket session availability and auto-reconnect if needed. Additionally, all module versions are bumped from 5.4.7 to 5.4.8.
- Refactored handler retrieval into a reusable private method
getHandler() - Added new
checkDesktop()method to verify and restore WebSocket connections - Improved Javadoc comment for
initWS()method
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| zk/src/main/java/tools/dynamia/zk/websocket/WebSocketPushSender.java | Added checkDesktop() method, extracted getHandler() helper method, improved documentation |
| zk/pom.xml | Version bump to 5.4.8 |
| web/pom.xml | Version bump to 5.4.8 |
| viewers/pom.xml | Version bump to 5.4.8 |
| ui/pom.xml | Version bump to 5.4.8 |
| templates/pom.xml | Version bump to 5.4.8 |
| starter/pom.xml | Version bump to 5.4.8 |
| reports/pom.xml | Version bump to 5.4.8 |
| pom.xml | Version bump to 5.4.8 |
| navigation/pom.xml | Version bump to 5.4.8 |
| io/pom.xml | Version bump to 5.4.8 |
| integration/pom.xml | Version bump to 5.4.8 |
| domain/pom.xml | Version bump to 5.4.8 |
| domain-jpa/pom.xml | Version bump to 5.4.8 |
| crud/pom.xml | Version bump to 5.4.8 |
| commons/pom.xml | Version bump to 5.4.8 |
| app/pom.xml | Version bump to 5.4.8 |
| actions/pom.xml | Version bump to 5.4.8 |
| public static void checkDesktop(Desktop desktop) { | ||
| var handler = getHandler(); | ||
| if (handler != null) { | ||
| var session = handler.findSession(desktop); | ||
| if (session == null || !session.isOpen()) { | ||
| initWS(); | ||
| } | ||
| } | ||
| } |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checkDesktop() method is missing the @param Javadoc tag for the desktop parameter. According to the project's coding guidelines, all public methods must include complete Javadoc with parameters documented using @param.
| public static void checkDesktop(Desktop desktop) { | ||
| var handler = getHandler(); | ||
| if (handler != null) { | ||
| var session = handler.findSession(desktop); | ||
| if (session == null || !session.isOpen()) { | ||
| initWS(); | ||
| } | ||
| } | ||
| } |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checkDesktop() method calls initWS() which operates on Executions.getCurrent().getDesktop() (via ZKUtil.isInEventListener()), but the Desktop parameter passed to checkDesktop() is not used by initWS(). This means the WebSocket will be initialized for the current execution context's desktop, not necessarily for the desktop parameter being checked. This could result in initializing the wrong Desktop's WebSocket connection.
No description provided.