From f96c190c619a2e2956ec5b8e35c3030aca21c831 Mon Sep 17 00:00:00 2001 From: Daniel Grigore Date: Tue, 6 May 2025 08:51:26 +0300 Subject: [PATCH 1/4] chore: spring boot 3.4.4 upgrade --- cosmo-api/pom.xml | 2 +- cosmo-core/pom.xml | 2 +- .../cosmo/dao/hibernate/ContentDaoImpl.java | 9 +++++++++ pom.xml | 6 +++--- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/cosmo-api/pom.xml b/cosmo-api/pom.xml index 7f6404af..824b6352 100644 --- a/cosmo-api/pom.xml +++ b/cosmo-api/pom.xml @@ -4,7 +4,7 @@ net.oneandone.cosmo cosmo-multimodule - 7.0.4-SNAPSHOT + 7.1.0-SNAPSHOT cosmo-api diff --git a/cosmo-core/pom.xml b/cosmo-core/pom.xml index b82995e7..892f44c2 100644 --- a/cosmo-core/pom.xml +++ b/cosmo-core/pom.xml @@ -12,7 +12,7 @@ net.oneandone.cosmo cosmo-multimodule - 7.0.4-SNAPSHOT + 7.1.0-SNAPSHOT 4.0.0 cosmo-core diff --git a/cosmo-core/src/main/java/org/unitedinternet/cosmo/dao/hibernate/ContentDaoImpl.java b/cosmo-core/src/main/java/org/unitedinternet/cosmo/dao/hibernate/ContentDaoImpl.java index 3df81db4..6d9db511 100644 --- a/cosmo-core/src/main/java/org/unitedinternet/cosmo/dao/hibernate/ContentDaoImpl.java +++ b/cosmo-core/src/main/java/org/unitedinternet/cosmo/dao/hibernate/ContentDaoImpl.java @@ -28,6 +28,7 @@ import org.unitedinternet.cosmo.dao.ContentDao; import org.unitedinternet.cosmo.dao.ModelValidationException; import org.unitedinternet.cosmo.model.CollectionItem; +import org.unitedinternet.cosmo.model.CollectionSubscription; import org.unitedinternet.cosmo.model.ContentItem; import org.unitedinternet.cosmo.model.ICalendarItem; import org.unitedinternet.cosmo.model.IcalUidInUseException; @@ -35,6 +36,7 @@ import org.unitedinternet.cosmo.model.NoteItem; import org.unitedinternet.cosmo.model.User; import org.unitedinternet.cosmo.model.hibernate.HibCollectionItem; +import org.unitedinternet.cosmo.model.hibernate.HibCollectionSubscriptionItem; import org.unitedinternet.cosmo.model.hibernate.HibItem; import org.unitedinternet.cosmo.model.hibernate.HibItemTombstone; @@ -346,6 +348,13 @@ private void removeCollectionRecursive(CollectionItem collection) { * Removing a collection does not automatically remove its children. Instead, the association to all the * children is removed, and any children who have no parent collection are then removed. */ + if (collection instanceof HibCollectionSubscriptionItem) { + HibCollectionSubscriptionItem subCollection = (HibCollectionSubscriptionItem) collection; + CollectionSubscription subScription = subCollection.getSubscription(); + if (subScription != null) { + this.em.detach(subScription); + } + } removeItemsFromCollection(collection); this.em.remove(collection); } diff --git a/pom.xml b/pom.xml index 6c08c1b7..ef281aeb 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ net.oneandone.cosmo cosmo-multimodule - 7.0.4-SNAPSHOT + 7.1.0-SNAPSHOT pom cosmo-multimodule CalDAV core implementation server @@ -27,7 +27,7 @@ false UTF-8 - 3.3.1 + 3.4.4 3.0.1 3.2.14 @@ -40,7 +40,7 @@ 1.0.1 4.0.6 - 2.17.2 + 2.18.3 1.1.3 5.10.3 From 6733d5f5807bdb50b14ff98be3fdb8022a34d2a9 Mon Sep 17 00:00:00 2001 From: Daniel Grigore Date: Tue, 6 May 2025 09:00:10 +0300 Subject: [PATCH 2/4] fix: new suggested workflow --- .github/workflows/maven.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 800d58a7..00d2c3c6 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,11 +1,3 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - name: Java CI with Maven on: @@ -16,18 +8,28 @@ on: jobs: build: - runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: run tests in java 17 + + - name: Cache Maven dependencies + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Set up Maven with Java 17 uses: s4u/setup-maven-action@v1.14.0 with: java-version: '17' distribution: 'temurin' maven-version: 3.9.4 - - name: Show maven version + + - name: Show Maven version run: mvn --version - - name: Build with Maven - run: mvn -B package --file pom.xml + + - name: Build with Maven + run: mvn -B package --file pom.xml \ No newline at end of file From ab8613b3710fe22097360f3507b52833c5ea58b1 Mon Sep 17 00:00:00 2001 From: Daniel Grigore Date: Tue, 6 May 2025 09:05:53 +0300 Subject: [PATCH 3/4] chore: generated workflow --- .github/workflows/maven.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 00d2c3c6..ff31b492 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,3 +1,11 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + name: Java CI with Maven on: @@ -8,28 +16,20 @@ on: jobs: build: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - - name: Cache Maven dependencies - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - - name: Set up Maven with Java 17 - uses: s4u/setup-maven-action@v1.14.0 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' - maven-version: 3.9.4 - - - name: Show Maven version - run: mvn --version - + cache: maven - name: Build with Maven - run: mvn -B package --file pom.xml \ No newline at end of file + run: mvn -B package --file pom.xml + + # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive + - name: Update dependency graph + uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 \ No newline at end of file From 4d14eaf44fa3114e3ca84424ea2c6f1b1a1f8292 Mon Sep 17 00:00:00 2001 From: Daniel Grigore Date: Tue, 6 May 2025 09:07:51 +0300 Subject: [PATCH 4/4] fix: remove dependency graph update --- .github/workflows/maven.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index ff31b492..657189d5 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -28,8 +28,4 @@ jobs: distribution: 'temurin' cache: maven - name: Build with Maven - run: mvn -B package --file pom.xml - - # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - - name: Update dependency graph - uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 \ No newline at end of file + run: mvn -B package --file pom.xml \ No newline at end of file