@fizz Hello, I've been able to make a test using the approach described above. The test was done in stable channel (OTA-22) after reboot and the commands have been punched via ssh.
I sent myself a testing multimedia message via the nuntium-inject-push testing helper tool.
phablet@ubuntu-phablet:~$ sudo ./nuntium-inject-push -s +421908353517 --sender-notification +421908353517 --transaction-id test-wget --error-activate-context=1
[sudo] password for phablet:
No end-point flag provided, trying to retrieve end-point from nuntium logs in: /home/phablet/.cache/upstart
Using endpoint: ":1.55"
Creating web server to serve mms
Denial count: 0
The notification was delivered to messaging-app
Screenshot - Message with notification
I looked at the ~/.cache/upstart/nuntium.log
phablet@ubuntu-phablet:~$ tail .cache/upstart/nuntium.log
00000060 39 30 38 33 35 33 35 31 37 2f 54 59 50 45 3d 50 |908353517/TYPE=P|
00000070 4c 4d 4e 00 8a 80 8e 02 74 00 88 05 81 03 02 a2 |LMN.....t.......|
00000080 ff 83 68 74 74 70 3a 2f 2f 6c 6f 63 61 6c 68 6f |..http://localho|
00000090 73 74 3a 39 31 39 31 2f 6d 6d 73 3f 65 72 72 6f |st:9191/mms?erro|
000000a0 72 2d 61 63 74 69 76 61 74 65 2d 63 6f 6e 74 65 |r-activate-conte|
000000b0 78 74 3d 31 00 |xt=1.|
2022/03/11 18:10:19 This is a local test, skipping context activation and proxy settings
2022/03/11 18:10:19 Forcing debug error: main.downloadError{standartizedError:main.standartizedError{error:"error-activate-context", code:"x-ubports-nuntium-mms-error-activate-context"}}
2022/03/11 18:10:31 Received unknown method call on org.ofono.mms.Message MarkRead
2022/03/11 18:10:31 Message /org/ofono/mms/231014453153205/cb2e5a6911b100a99a13927694308474 is not responded and not expired, not deleting.
and extracted the message UUID cb2e5a6911b100a99a13927694308474 and download link http://localhost:9191/mms.
(Note: in the log there is "?error-activate-context=1" in the url. This is a testing string specific for the nuntium-inject-push tool and I know it's safe to remove. In real world usage use the whole link)
I downloaded the message content with wget using the download link into the storage as <UUID>.mms
phablet@ubuntu-phablet:~$ wget -O - http://localhost:9191/mms > ~/.local/share/nuntium/store/cb2e5a6911b100a99a13927694308474.mms
--2022-03-11 18:23:50-- http://localhost:9191/mms
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:9191... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:9191... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3405 (3,3K) [application/octet-stream]
Saving to: ‘STDOUT’
- 100%[=========================================================================>] 3,33K --.-KB/s in 0s
2022-03-11 18:23:50 (79,2 MB/s) - written to stdout [3405/3405]
And checked, if there is the file in the storage folder. (Note: I've also appended, what the files look like.)
phablet@ubuntu-phablet:~$ ls -l ~/.local/share/nuntium/store/
total 8
-rw------- 1 phablet phablet 653 mar 11 18:10 cb2e5a6911b100a99a13927694308474.db
-rw-rw-r-- 1 phablet phablet 3405 mar 11 18:23 cb2e5a6911b100a99a13927694308474.mms
phablet@ubuntu-phablet:~$ head -c 200 ~/.local/share/nuntium/store/cb2e5a6911b100a99a13927694308474.mms
���test-wget���abcdefghipqrrst�TZ�7��+421908353517/TYPE=PLMN��application/smil�<smil>/�+pplication/smil�smil.xml�smil.xml�"<smil><smil> <head> <layout> <region id="Image
phablet@ubuntu-phablet:~$ head ~/.local/share/nuntium/store/cb2e5a6911b100a99a13927694308474.db
{"Id":"test-wget","State":"notification","ContentLocation":"http://localhost:9191/mms?error-activate-context=1","SendState":null,"ModemId":"231014453153205","MNotificationInd":{"MMSReader":null,"UUID":"cb2e5a6911b100a99a13927694308474","RedownloadOfUUID":"","Received":"2022-03-11T18:10:19.122527716+01:00","Type":130,"Version":144,"Class":128,"DeliveryReport":0,"ReplyCharging":0,"ReplyChargingDeadline":0,"Priority":0,"ReplyChargingId":"","TransactionId":"test-wget","ContentLocation":"http://localhost:9191/mms","From":"+421908353517/TYPE=PLMN","Subject":"","Expiry":"2022-03-13T18:10:18.122527716+01:00","Size":29696},"TelepathyErrorNotified":true}
I edited the ~/.local/share/nuntium/store/cb2e5a6911b100a99a13927694308474.db file and changed the State to "downloaded" and TelepathyErrorNotified to "false".
phablet@ubuntu-phablet:~$ sed -i 's/"State":"notification"/"State":"downloaded"/' ~/.local/share/nuntium/store/cb2e5a6911b100a99a13927694308474.db
phablet@ubuntu-phablet:~$ sed -i 's/"TelepathyErrorNotified":true/"TelepathyErrorNotified":false/' ~/.local/share/nuntium/store/cb2e5a6911b100a99a13927694308474.db
phablet@ubuntu-phablet:~$ head ~/.local/share/nuntium/store/cb2e5a6911b100a99a13927694308474.db
{"Id":"test-wget","State":"downloaded","ContentLocation":"http://localhost:9191/mms?error-activate-context=1","SendState":null,"ModemId":"231014453153205","MNotificationInd":{"MMSReader":null,"UUID":"cb2e5a6911b100a99a13927694308474","RedownloadOfUUID":"","Received":"2022-03-11T18:10:19.122527716+01:00","Type":130,"Version":144,"Class":128,"DeliveryReport":0,"ReplyCharging":0,"ReplyChargingDeadline":0,"Priority":0,"ReplyChargingId":"","TransactionId":"test-wget","ContentLocation":"http://localhost:9191/mms","From":"+421908353517/TYPE=PLMN","Subject":"","Expiry":"2022-03-13T18:10:18.122527716+01:00","Size":29696},"TelepathyErrorNotified":false}
I restarted nuntium (should be the same as restarting the phone)
phablet@ubuntu-phablet:~$ initctl --user restart nuntium
nuntium start/running, process 10665
There is the message instead of notification in the messaging app.
Screenshot - Test message instead of notification
Here you can see the relevant logs produced in this test for comparsion.
For the record, I've also encountered a case, where the message was not delivered to messaging-app after restart, but it was due to bad wget usage, which produced an empty .mms file. So maybe if the file is somehow faulty, the message is not shown. This needs more investigation.