oxen-io / session-android

A private messenger for Android.
https://getsession.org
GNU General Public License v3.0
1.73k stars 165 forks source link

SES1889 - CursorIndexOutOfRangeException fix #1479

Closed AL-Session closed 1 month ago

AL-Session commented 1 month ago

Contributor checklist


Description

Android build v1.18.2 is exhibiting issues relating to a CursorIndexOutOfRangeException. While the root cause of this issue is unknown at the present time, we can at least catch the exception and print some debug related to what's occurred, which will also prevent the app from crashing.

A potentially braver solution would be to catch the exception so we can identify what's causing it, then re-throw it to crash the app. In this way we'll see the root cause in the Play Store crash reports and can address it, but the app will crash, which isn't great.

All changes are in AttachmentDatabase.java lines 745-824 - everything else is just reformatting.