Skip to content

Commit 87bf9b1

Browse files
committed
Fix message handling
1 parent ed121b0 commit 87bf9b1

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

android/app/src/main/kotlin/com/bluebubbles/messaging/services/rustpush/AppleAccountLoginHandler.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class AppleAccountLoginHandler: MethodCallHandlerImpl() {
4747
Constants.appleAccountLoginAttemptTag
4848
)
4949
}
50+
result.success(null)
5051
return
5152
}
5253

lib/services/rustpush/rustpush_service.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3075,7 +3075,7 @@ class RustPushService extends GetxService {
30753075

30763076
Future handleMsg(api.PushMessage push, bool finalAttempt) async {
30773077
try {
3078-
await handleMsgInner(push);
3078+
await handleMsgInner(push).timeout(const Duration(minutes: 3));
30793079
} catch (e, s) {
30803080
if (finalAttempt) markCertified(push);
30813081
rethrow;
@@ -4414,14 +4414,15 @@ class RustPushService extends GetxService {
44144414
}
44154415
Logger.info("waitingForInit $pointer $retry");
44164416
await initFuture;
4417+
var isFinal = (int.tryParse(retry) ?? 3) >= 3;
44174418
try {
44184419
Logger.info("Handling $pointer $retry");
4419-
await handleMsg(message, retry == "3");
4420+
await handleMsg(message, isFinal);
44204421
Logger.info("Marking as handled $pointer");
44214422
await markAsHandledAfter(pointer);
44224423
} catch (e, s) {
44234424
Logger.error("Handle failed", error: e, trace: s);
4424-
if (retry == "3") {
4425+
if (isFinal) {
44254426
Logger.info("Failed; Marking as handled anyways $pointer");
44264427
await markAsHandledAfter(pointer);
44274428
}

pubspec.lock

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,12 +1018,11 @@ packages:
10181018
flutter_isolate:
10191019
dependency: "direct main"
10201020
description:
1021-
path: "."
1022-
ref: "user/chip/update-examples"
1023-
resolved-ref: bf7deabbb1aaa3cff785b636d9f4717d4fe202d9
1024-
url: "https://github.com/chipweinberger/flutter_isolate.git"
1025-
source: git
1026-
version: "2.0.5-pre"
1021+
name: flutter_isolate
1022+
sha256: "36a84e1a22371d8092ea2121145b330c24fb272acb951fb30c60ba44926b8fb3"
1023+
url: "https://pub.dev"
1024+
source: hosted
1025+
version: "2.1.0"
10271026
flutter_keyboard_visibility:
10281027
dependency: "direct main"
10291028
description:

0 commit comments

Comments
 (0)