diff --git a/lib/push/send-utils.js b/lib/push/send-utils.js --- a/lib/push/send-utils.js +++ b/lib/push/send-utils.js @@ -993,7 +993,25 @@ } try { - await Promise.allSettled(olmSessionCreationPromises); + // The below is equvialent to + // Promise.allSettled(olmSessionCreationPromises), which appears to be + // undefined in Android (at least on debug builds) as of Sept 2024 + await Promise.all( + olmSessionCreationPromises.map(async promise => { + try { + const result = await promise; + return ({ + status: 'fulfilled', + value: result, + }: $SettledPromiseResult); + } catch (e) { + return ({ + status: 'rejected', + reason: e, + }: $SettledPromiseResult); + } + }), + ); } catch (e) { // session creation may fail for some devices // but we should still pursue notification