Several times a week I run the fixsms script.
#! /bin/sh
mmcli -m any --messaging-list-sms | awk '{print $1}' | xargs -I {} mmcli -m any --messaging-delete-sms={}
I have noticed that even after 12 hours or so I can have at least 5-6 stuck SMSs. Are these lost MMSs or maybe the doubles or triples you sometimes see from Xiaomi phones?
purism@pureos:~$ sudo ./fixsms
[sudo] password for purism:
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
error: couldn't delete SMS: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: Couldn't delete 1 parts from this SMS'
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
purism@pureos:~$ sudo ./fixsms
successfully deleted SMS from modem
purism@pureos:~$ sudo ./fixsms
[sudo] password for purism:
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
successfully deleted SMS from modem
above is a SSH link to my Librem 5 after maybe 4 days followed by an evening and rerunning the script again in the morning where I exchanged a few SMSs before sleeping. I can confirm a similar number of stuck SMSs where to be had over the several years of using Pinephone and PinephonePro.
(edit) a few hours later three more stuck SMSs.