-
Notifications
You must be signed in to change notification settings - Fork 3
Long Operations Improvements #44
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
…r tools and entityfiles versions; enhance PushTestViewModel and LongOperation for better progress handling
…ple exception and progress consumers; add logging feature for progress updates
…ringboot and dynamiatools versions
… functions and improved clipboard handling
…ions to 5.4.12; bump springdoc-openapi version to 2.8.12 and use variable for spring-boot-maven-plugin version
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 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
LongOperationclass 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
ZKUtilfor delayed and interval-based task execution - Refactoring from
ObjectMappertoJsonMapperacross 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 |
Copilot
AI
Dec 28, 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 Javadoc still references 'ObjectMapper' when the return type has been changed to 'JsonMapper'. Update the Javadoc comment to accurately reflect the return type.
| * @return the configured JSON ObjectMapper | |
| * @return the configured JSON {@link JsonMapper} |
| 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> |
Copilot
AI
Dec 28, 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 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.
| <artifactId>tools.dynamia.commons</artifactId> | |
| <artifactId>tools.dynamia.commons</artifactId> | |
| <version>5.4.12</version> |
|
|
||
| /** | ||
| * optional callback method when the task has completed (always called) | ||
| * Register callback when an uncaught exception occurs. Supports multiple consumers. |
Copilot
AI
Dec 28, 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 method comment states 'Sopports multiple consumers' but contains a spelling error. It should be 'Supports multiple consumers'.
| public static LongOperation create() { | ||
| return new LongOperation(); | ||
| } |
Copilot
AI
Dec 28, 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 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.
| public static void runAtIntervals(Duration interval, Page page, Runnable runnable) { | ||
| if (ZKUtil.isInDesktopScope()) { | ||
| buildTimer(interval, page, true, runnable); |
Copilot
AI
Dec 28, 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.
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.
| * to {@link JavaTimeModule} from JSR310 dependency | ||
| * | ||
| * @return xml ObjectMapper | ||
| * @return xml mapper |
Copilot
AI
Dec 28, 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 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.
| * @return xml mapper | |
| * @return configured {@link XmlMapper} instance |
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-maven-plugin</artifactId> | ||
| <version>3.4.4</version> | ||
| <version>${springboot.version}</version> |
Copilot
AI
Dec 28, 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 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.
| */ | ||
| public static void runLater(Duration duration, Page page, Runnable runnable) { | ||
| if (ZKUtil.isInDesktopScope()) { | ||
| buildTimer(duration, page, false, runnable); |
Copilot
AI
Dec 28, 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 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.
| buildTimer(duration, page, false, runnable); | |
| Timer timer = buildTimer(duration, page, false, runnable); | |
| if (timer != null) { | |
| timer.setPage(page); | |
| } |
| @@ -0,0 +1,156 @@ | |||
| /* | |||
| * Copyright (C) 2023 Dynamia Soluciones IT S.A.S - NIT 900302344-1 | |||
Copilot
AI
Dec 28, 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 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.
| Page page = findPage(path); | ||
| setCurrentPage(page, params); | ||
| } | ||
| }else{ |
Copilot
AI
Dec 28, 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 formatting is inconsistent. There should be a space after 'else' before the opening brace to match Java coding conventions.
| }else{ | |
| } else { |
No description provided.