From a58de2278ba1c64fbea455ed9089df064b074b0d Mon Sep 17 00:00:00 2001 From: adbenitez Date: Thu, 9 Jan 2025 18:36:12 +0100 Subject: [PATCH 1/4] use synchronized block to avoid IllegalMonitorStateException --- .../securesms/service/FetchForegroundService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/thoughtcrime/securesms/service/FetchForegroundService.java b/src/main/java/org/thoughtcrime/securesms/service/FetchForegroundService.java index 47b93b4d8..5481ca8f2 100644 --- a/src/main/java/org/thoughtcrime/securesms/service/FetchForegroundService.java +++ b/src/main/java/org/thoughtcrime/securesms/service/FetchForegroundService.java @@ -53,7 +53,9 @@ public final class FetchForegroundService extends Service { try { // The `wait()` needs to be enclosed in a while loop because there may be // "spurious wake-ups", i.e. `wait()` may return even though `notifyAll()` wasn't called. - STOP_NOTIFIER.wait(); + synchronized (STOP_NOTIFIER) { + STOP_NOTIFIER.wait(); + } } catch (InterruptedException ex) { } } } @@ -63,7 +65,9 @@ public final class FetchForegroundService extends Service { public static void stop(Context context) { if (fetchingSynchronously) { fetchingSynchronously = false; - STOP_NOTIFIER.notifyAll(); + synchronized (STOP_NOTIFIER) { + STOP_NOTIFIER.notifyAll(); + } } synchronized (SERVICE_LOCK) { From 66fd795763fcec2f48c124261edfcf4f2ea25d54 Mon Sep 17 00:00:00 2001 From: adbenitez Date: Thu, 9 Jan 2025 19:06:15 +0100 Subject: [PATCH 2/4] try to fix CI --- .github/workflows/preview-apk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview-apk.yml b/.github/workflows/preview-apk.yml index cc509841f..e297073fe 100644 --- a/.github/workflows/preview-apk.yml +++ b/.github/workflows/preview-apk.yml @@ -49,7 +49,7 @@ jobs: run: ./gradlew --no-daemon assembleGplayDebug - name: Upload APK - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: app-preview.apk path: 'build/outputs/apk/gplay/debug/*.apk' From 35339161496626077da238460f215e673f54498a Mon Sep 17 00:00:00 2001 From: Hocuri Date: Fri, 10 Jan 2025 11:05:44 +0100 Subject: [PATCH 3/4] Put the `synchronized` around the whole while loop --- .../securesms/service/FetchForegroundService.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/thoughtcrime/securesms/service/FetchForegroundService.java b/src/main/java/org/thoughtcrime/securesms/service/FetchForegroundService.java index 5481ca8f2..341559663 100644 --- a/src/main/java/org/thoughtcrime/securesms/service/FetchForegroundService.java +++ b/src/main/java/org/thoughtcrime/securesms/service/FetchForegroundService.java @@ -49,14 +49,14 @@ public final class FetchForegroundService extends Service { // The background fetch was successful, but we need to wait until all events were processed. // After all events were processed, we will get DC_EVENT_ACCOUNTS_BACKGROUND_FETCH_DONE, // and stop() will be called. - while (fetchingSynchronously) { - try { - // The `wait()` needs to be enclosed in a while loop because there may be - // "spurious wake-ups", i.e. `wait()` may return even though `notifyAll()` wasn't called. - synchronized (STOP_NOTIFIER) { + synchronized (STOP_NOTIFIER) { + while (fetchingSynchronously) { + try { + // The `wait()` needs to be enclosed in a while loop because there may be + // "spurious wake-ups", i.e. `wait()` may return even though `notifyAll()` wasn't called. STOP_NOTIFIER.wait(); - } - } catch (InterruptedException ex) { } + } catch (InterruptedException ex) {} + } } } } From 489bb55788121ef056cc44d3ac78a54142ba52ac Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 10 Jan 2025 14:06:58 +0100 Subject: [PATCH 4/4] detach Android and iOS releases --- scripts/upload-beta.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/upload-beta.sh b/scripts/upload-beta.sh index 71e274b6a..74bf8d5ea 100755 --- a/scripts/upload-beta.sh +++ b/scripts/upload-beta.sh @@ -30,7 +30,6 @@ echo "" echo "and now: here is Delta Chat $VERSION - choose your flavour and mind your backups:" echo "- 🍋 https://download.delta.chat/android/beta/deltachat-gplay-release-$VERSION.apk (google play candidate, overwrites existing installs, should keep data)" echo "- 🍉 https://download.delta.chat/android/beta/deltachat-foss-debug-$VERSION.apk (f-droid candidate, can be installed beside google play)" -echo "- 🍏 https://testflight.apple.com/join/uEMc1NxS (ios, update to $VERSION may take a day or so)" echo "" echo "what to test: PLEASE_FILL_OUT"