octoshrimpy / quik

The most beautiful SMS messenger for Android - Revived
GNU General Public License v3.0
590 stars 26 forks source link

:lady_beetle: [BUG] Widget regression from forking QKSMS v3.10.1 #98

Open e-t-l opened 5 months ago

e-t-l commented 5 months ago

Describe the bug This bug was originally filed at https://github.com/moezbhatti/qksms/issues/1909. It appears that QKSMS's latest version (3.10.1) introduced a regression where tapping a conversation in the widget launches the main app activity instead of launching that specific contact's conversation view. Moez confirmed the bug but didn't provide a solution other than downgrading to v3.9.4.

This bug is also present in Quik. I'm guessing you forked the latest version of QKSMS, but please be aware that only QKSMS v3.9.4 is considered the last stable version.

To reproduce

  1. Place the widget on your homescreen
  2. Tap a conversation on the widget

Expected behavior The selected conversation view is opened. Instead, the main QKSMS activity (aka list of threads) is opened.

Smartphone:

1472583610 commented 5 months ago

I may have found the bug.

In WidgetProvider.kt, line 153, specifies the startActivityPendingIntent as immulatable (FLAG_IMMUTABLE). This causes the pending intent to be, well, immutable, so when the adapter creates clickIntent to use in setOnClickFillInIntent, the pending intent cannot be updated with the specified extras.

Changing the flag to FLAG_MUTABLE seems to fix the issue.

Disclaimer: I have never programmed a single Android application in my life, not even a Hello World. I'm going through the code and trying to make heads and tails of it only using my knowledge from other languages AND platforms, with some apparently good pointers from GenAI. I'm unable to foresee all the consequences of setting the mutability flag.

octoshrimpy commented 4 months ago

I'm going through the code and trying to make heads and tails of it you and I, friend. Thank you for the catch! I will definitely poke around and see what I can do about it!

1472583610 commented 4 months ago

I'm going through the code and trying to make heads and tails of it you and I, friend. Thank you for the catch! I will definitely poke around and see what I can do about it!

My pleasure. Thank you for all the hard work you've put in this app, I'm very grateful to both Moez and yourself it exists, it's perfect for what I need and like.