From 6fa10d71110b007fad8b612acfbbc242d42f3025 Mon Sep 17 00:00:00 2001 From: Enginex0 Date: Tue, 19 May 2026 05:03:19 +0100 Subject: [PATCH] fix(spoof): wrap pollOnce in umbrella try/catch fetchAndParse and appendHistory each catch their own exceptions, but scheduleNext can throw IllegalStateException if the Looper is torn down or any helper raises an unanticipated error. Without an outer catch, the reschedule chain broke and the poller stayed dead until reboot. Wrap the entire body so a thrown exception still attempts to schedule the next poll. --- .../org/matrix/TEESimulator/config/BulletinPoller.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/matrix/TEESimulator/config/BulletinPoller.kt b/app/src/main/java/org/matrix/TEESimulator/config/BulletinPoller.kt index 49888ec..70eeeb2 100644 --- a/app/src/main/java/org/matrix/TEESimulator/config/BulletinPoller.kt +++ b/app/src/main/java/org/matrix/TEESimulator/config/BulletinPoller.kt @@ -36,9 +36,14 @@ object BulletinPoller { } private fun pollOnce() { - val result = fetchAndParse() - appendHistory(result) - scheduleNext(result.status == "success") + try { + val result = fetchAndParse() + appendHistory(result) + scheduleNext(result.status == "success") + } catch (t: Throwable) { + SystemLogger.error("BulletinPoller: pollOnce failed", t) + scheduleNext(false) + } } private fun scheduleNext(success: Boolean) {