From fbb171bdfe180ff8c1204e3025669fca1eba388f Mon Sep 17 00:00:00 2001 From: Deepak Dixit Date: Wed, 29 Nov 2023 10:29:14 +0530 Subject: [PATCH] Upstream sync (#10) * Fix regression with partitioned tables in PostgreSQL PostgreSQL JDBC Driver introduced separating type for partitioned table from 40.2.12 pgjdbc/pgjdbc#1708 * Add subscreensItem.menuInclude to menu data (#600) * Fixed the problem that moqui cannot be deployed as non-root webapp in Tomcat * Fixed a runtime error if Currency is BTC * Fixed a runtime error if Currency is BTC * Fixed the retries of Elastic Client * Add subscreensItem.menuInclude to menu data * Docker-Image-Pull Feature (#553) * Improvement: In Moqui-Multi-Instance added a Async-Pull-Image-Feature which pulls the image by Using Docker-Engine-Api from multiple registry like AWS, Azure, Docker-Hub * Update AUTHORS * Added: added the generic way to process cmd , by adding an extra field(authTokenPass) inside the entity InstanceImage , now user has separate field for cmd and password so all types of registries is easily configurable * Update ServerEntities.xml by adding description * Library updates, including Jetty 10.0.13 to 10.015 which had reported vulnerabilities; there are lots of dependencies updated in this set, see diff for full details * In ScreenRenderImpl change addFormFieldValue() and related methods to handle first, second, and last rows, for qvt and other client rendered output that needs full data for a form in a map/object * In root build.gradle change gitStatusAll task to be more tolerant of repos with no master branch * Add text-area.@autogrow attribute, supported only in qvt for now * Update various libraries including Groovy to 3.0.19 (which has some minor non-backward compatible changes single 3.0.10 with odd boolean behavior in rare cases, adjusted for in the framework long ago but should be watched for in custom code), Jetty to 10.0.16, H2 database, SLF4J, SnakeYAML, Apache Commons Lang3 * In build.gradle gitStatusAll task also handle upstream remotes with no master branch * Currency (#614) * Use moqui.basic.Uom entity to determine currency formatting and rounding details * Add currency-hide-symbol attribute as a complement to currency-unit-field, displaying the value without the currency symbol * Update authors file * Add and Handle Hmac Sha256 with timestamp * A couple of minor bug fixes in the EntityAutoServiceRunner and ContextJavaUtil (#618) * In EntityAutoServiceRunner, remove unwanted break statement to ensure support for multiple PK fields with wildcard (*). * In ContextJavaUtil, add missing future keyword. * Updated authors file. * Allow for 10 second threshold in nowTimestamp * In L10nFacadeImpl.formatCurrency() use disableAuthz() for entity find on Uom; small change to currency formatting test to pass with current OOTB settings * In addons.xml, added new moqui-sso component. * Add AutoCloseable extension to EntityListIterator for use with try with resources, thanks to Deepak Dixit for the suggestion * BugFix EntityListIterator not closed in NotificationMessageImpl#getNotifyUserIds --------- Co-authored-by: Yao Chunlin Co-authored-by: David E. Jones Co-authored-by: Wei Zhang Co-authored-by: Rohit pawar <72196393+rohitpawar2811@users.noreply.github.com> Co-authored-by: Jens Hardings Co-authored-by: acetousk Co-authored-by: Ayman Abi Abdallah --- .../impl/context/NotificationMessageImpl.groovy | 16 ++++++++++------ .../org/moqui/entity/EntityListIterator.java | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/framework/src/main/groovy/org/moqui/impl/context/NotificationMessageImpl.groovy b/framework/src/main/groovy/org/moqui/impl/context/NotificationMessageImpl.groovy index 43988372d..63bc08178 100644 --- a/framework/src/main/groovy/org/moqui/impl/context/NotificationMessageImpl.groovy +++ b/framework/src/main/groovy/org/moqui/impl/context/NotificationMessageImpl.groovy @@ -96,12 +96,16 @@ class NotificationMessageImpl implements NotificationMessage, Externalizable { EntityListIterator eli = ef.find("moqui.security.UserGroupMember") .conditionDate("fromDate", "thruDate", new Timestamp(System.currentTimeMillis())) .condition("userGroupId", userGroupId).disableAuthz().iterator() - EntityValue nextValue - while ((nextValue = (EntityValue) eli.next()) != null) { - String userId = (String) nextValue.userId - if (checkedUserIds.contains(userId)) continue - checkedUserIds.add(userId) - if (checkUserNotify(userId, ef)) notifyUserIds.add(userId) + try { + EntityValue nextValue + while ((nextValue = (EntityValue) eli.next()) != null) { + String userId = (String) nextValue.userId + if (checkedUserIds.contains(userId)) continue + checkedUserIds.add(userId) + if (checkUserNotify(userId, ef)) notifyUserIds.add(userId) + } + } finally { + eli.close(); } } diff --git a/framework/src/main/java/org/moqui/entity/EntityListIterator.java b/framework/src/main/java/org/moqui/entity/EntityListIterator.java index 639431001..7dea9643a 100644 --- a/framework/src/main/java/org/moqui/entity/EntityListIterator.java +++ b/framework/src/main/java/org/moqui/entity/EntityListIterator.java @@ -20,7 +20,7 @@ * Entity Cursor List Iterator for Handling Cursored Database Results */ @SuppressWarnings("unused") -public interface EntityListIterator extends ListIterator { +public interface EntityListIterator extends ListIterator, AutoCloseable { /** Close the underlying ResultSet and Connection. This must ALWAYS be called when done with an EntityListIterator. */ void close() throws EntityException;