Messages icon indicating copy to clipboard operation
Messages copied to clipboard

Import doesn't include all messages on Android 14 due to subscriptionId issue

Open tom93 opened this issue 1 year ago • 0 comments

Checklist

  • [X] I can reproduce the bug with the latest version given here.
  • [X] I made sure that there are no existing issues - open or closed - to which I could contribute my information.
  • [X] I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
  • [X] I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
  • [X] I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • [X] This issue contains only one bug.
  • [X] I have read and understood the contribution guidelines.

Affected app version

1.0.1

Affected Android/Custom ROM version

Android 14 (does not happen on Android 13)

Affected device model

Emulator

How did you install the app?

GitHub releases

Steps to reproduce the bug

  1. Import the following backup: subscriptionId-test.json
  2. Switch to the conversation list.
  3. Observe the conversation snippet.
  4. Open the conversation and observe the messages.
  5. Return to the conversation list and observe the snippet.
  6. Try to delete the conversation.

(The backup was specially crafted to contain messages with subscriptionId values -1 to 4, but this issue can also happen with real backups on phones that have been used with more than one SIM card.)

Expected behavior

There should be 6 messages:

Test subscriptionId -1 Test subscriptionId 0 Test subscriptionId 1 Test subscriptionId 2 Test subscriptionId 3 Test subscriptionId 4

The snippet should be "Test subscriptionId 4".

Actual behavior

The conversation snippet is initially "Test subscriptionId 4" (which is correct). The messages in the conversation are only "Test subscriptionId -1" and "Test subscriptionId 1" (depending on the SIM card). When returning to the conversation list, the snippet is now "Test subscriptionId 1". When deleting the conversation, the messages are removed from the conversation but the conversation remains in the conversation list (and the snippet becomes "Test subscriptionId 4").

Screenshots/Screen recordings

https://github.com/user-attachments/assets/610caf38-8add-4096-b29b-b22c42c3b8e3

Additional information

Equivalent bug in the "SMS Import / Export" app, with some analysis: https://github.com/tmo1/sms-ie/issues/128 They decided to work around Android's behaviour by setting the subscription ID to -1 (unknown) during import. I suggest we do the same: #192.

Credit: SMS Import / Export, @BlastboomStrice (https://github.com/FossifyOrg/Messages/issues/88#issuecomment-2088264358), @miru299 (#188), @gusr (https://github.com/FossifyOrg/Messages/issues/6#issuecomment-2226294769).

tom93 avatar Jul 15 '24 13:07 tom93