Skip to content

Conversation

@marioserrano09
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings December 28, 2025 13:57
@marioserrano09 marioserrano09 merged commit 32d4516 into main Dec 28, 2025
3 checks passed
Copy link

Copilot AI left a 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 pull request refactors the long-running operations system in DynamiaTools with significant improvements including WebSocket support, EventQueue-based UI notifications, and enhanced documentation. The changes bump the framework version from 5.4.11 to 5.4.12.

Key Changes:

  • Complete rewrite of LongOperation class using EventQueue pattern instead of manual desktop activation/deactivation
  • New WebSocket client implementation for real-time server-to-client communication with automatic reconnection
  • Addition of timer utility methods in ZKUtil for delayed and interval-based task execution
  • Refactoring from ObjectMapper to JsonMapper across multiple modules for better type safety

Reviewed changes

Copilot reviewed 31 out of 32 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
zk/src/main/resources/static/dynamia-tools/js/zk/dynamia-tools-ws.js New WebSocket client with exponential backoff reconnection and keep-alive support
zk/src/main/resources/static/dynamia-tools/js/zk/dynamia-tools.js Moved and enhanced with comprehensive JSDoc documentation
zk/src/main/resources/static/dynamia-tools/js/dynamia-tools.js Removed old version, functionality moved to zk subdirectory
zk/src/main/resources/metainfo/zk/lang-addon.xml Updated JavaScript path reference to new location
zk/src/main/java/tools/dynamia/zk/util/ZKUtil.java Added runLater and runAtIntervals utility methods with Duration support
zk/src/main/java/tools/dynamia/zk/util/ResultLongOperation.java Deleted class - functionality integrated into base LongOperation
zk/src/main/java/tools/dynamia/zk/util/LongOperation.java Complete rewrite using EventQueue pattern with progress support
zk/src/main/java/tools/dynamia/zk/ui/LongOperationMonitorWindow.java Refactored to use new LongOperation event-based API
zk/pom.xml Version bump and added failureaccess dependency
web/src/main/java/tools/dynamia/web/navigation/RestNavigationController.java Replaced ObjectMapper with JsonMapper factory method
web/pom.xml Version bump to 5.4.12
viewers/src/main/java/tools/dynamia/viewers/JsonView.java Migrated from ObjectMapper to JsonMapper
viewers/pom.xml Version bump to 5.4.12
ui/pom.xml Version bump to 5.4.12
templates/pom.xml Version bump to 5.4.12
starter/pom.xml Version bump, updated springdoc-openapi and Spring Boot plugin version
reports/pom.xml Version bump to 5.4.12
pom.xml Parent version bump and Spring Boot update to 3.5.9
navigation/src/main/java/tools/dynamia/navigation/BaseNavigationManager.java Added null safety check for navigation path
navigation/pom.xml Version bump to 5.4.12
io/pom.xml Version bump to 5.4.12
integration/src/main/java/tools/dynamia/integration/scheduling/SchedulerUtil.java Changed return type from void to CompletableFuture
integration/pom.xml Version bump to 5.4.12
domain/pom.xml Version bump to 5.4.12
domain-jpa/pom.xml Version bump to 5.4.12
crud/pom.xml Version bump to 5.4.12
commons/src/main/java/tools/dynamia/commons/math/Randoms.java New utility class for random value generation
commons/src/main/java/tools/dynamia/commons/StringPojoParser.java Replaced ObjectMapper with JsonMapper/XmlMapper
commons/pom.xml Version bump to 5.4.12
app/src/main/java/tools/dynamia/app/controllers/CrudServiceRestController.java Updated to use JsonMapper instead of ObjectMapper
app/pom.xml Version bump to 5.4.12
actions/pom.xml Version bump to 5.4.12

* Creates a configured JSON {@link ObjectMapper} with indentation, disabled empty beans, and JavaTimeModule support.
* Creates a configured JSON {@link JsonMapper} with indentation, disabled empty beans, and JavaTimeModule support.
*
* @return the configured JSON ObjectMapper
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Javadoc still references 'ObjectMapper' when the return type has been changed to 'JsonMapper'. Update the Javadoc comment to accurately reflect the return type.

Suggested change
* @return the configured JSON ObjectMapper
* @return the configured JSON {@link JsonMapper}

Copilot uses AI. Check for mistakes.
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>tools.dynamia.commons</artifactId>
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version number is missing from commons/pom.xml. While it may be inherited from the parent, it's inconsistent with the pattern used in other module pom.xml files where the version is explicitly declared. Consider adding the version tag for consistency.

Suggested change
<artifactId>tools.dynamia.commons</artifactId>
<artifactId>tools.dynamia.commons</artifactId>
<version>5.4.12</version>

Copilot uses AI. Check for mistakes.

/**
* optional callback method when the task has completed (always called)
* Register callback when an uncaught exception occurs. Supports multiple consumers.
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method comment states 'Sopports multiple consumers' but contains a spelling error. It should be 'Supports multiple consumers'.

Copilot uses AI. Check for mistakes.
Comment on lines 308 to 310
public static LongOperation create() {
return new LongOperation();
}
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The static factory method 'create(TaskExecutor)' has been removed, which is a breaking API change. If external code relied on this method to provide a custom TaskExecutor, they will need to be migrated. Consider documenting this breaking change or providing an alternative API if custom executors are still needed.

Copilot uses AI. Check for mistakes.
Comment on lines +1342 to +1344
public static void runAtIntervals(Duration interval, Page page, Runnable runnable) {
if (ZKUtil.isInDesktopScope()) {
buildTimer(interval, page, true, runnable);
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to runLater, the buildTimer method is called but the returned timer is not captured or started, which means the timer will never execute. The timer should either be started within buildTimer by calling setPage(), or the method should capture and start the returned timer.

Copilot uses AI. Check for mistakes.
* to {@link JavaTimeModule} from JSR310 dependency
*
* @return xml ObjectMapper
* @return xml mapper
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Javadoc incorrectly describes the return type as 'xml ObjectMapper' when it should be 'XmlMapper'. The return type in the method signature has been updated to XmlMapper, but the Javadoc comment should reflect this more accurately.

Suggested change
* @return xml mapper
* @return configured {@link XmlMapper} instance

Copilot uses AI. Check for mistakes.
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>3.4.4</version>
<version>${springboot.version}</version>
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded version '3.4.4' has been replaced with '${springboot.version}', but the comment on line 67 may need verification. The parent pom.xml shows springboot.version being updated to 3.5.9. Ensure this is the intended Spring Boot version for the spring-boot-maven-plugin.

Copilot uses AI. Check for mistakes.
*/
public static void runLater(Duration duration, Page page, Runnable runnable) {
if (ZKUtil.isInDesktopScope()) {
buildTimer(duration, page, false, runnable);
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The buildTimer method creates and configures a Timer but does not start it. The timer needs to be attached to a component or have setPage() called to start. In the runLater and runAtIntervals methods, buildTimer is called but the returned timer is not captured or started, which means the timer will never execute. The timer should either be started within buildTimer by calling setPage(), or the methods should capture and start the returned timer.

Suggested change
buildTimer(duration, page, false, runnable);
Timer timer = buildTimer(duration, page, false, runnable);
if (timer != null) {
timer.setPage(page);
}

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,156 @@
/*
* Copyright (C) 2023 Dynamia Soluciones IT S.A.S - NIT 900302344-1
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright year is 2023, but this appears to be a new file added in 2025 based on the PR context. Consider updating the copyright year to 2025 for consistency.

Copilot uses AI. Check for mistakes.
Page page = findPage(path);
setCurrentPage(page, params);
}
}else{
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting is inconsistent. There should be a space after 'else' before the opening brace to match Java coding conventions.

Suggested change
}else{
} else {

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants