Closed Bug 1026526 Opened 6 years ago Closed 6 years ago

MobileMessageDB ConstraintError when sending SMS to new recipient

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: gerard-majax, Assigned: vicamo)

Details

Attachments

(1 file)

This seems to reproduce only on Janx' Flame for now, previously on v2.0 and now on master.

STR:
 0. Make sur you have no pre-existing thread for this recipient
 1. Send a SMS to this recipient

Expected:
 New SMS is sent

Actual:
 Error popping.
The error comes from the |aThreadStore.add(threadRecord)| call, visible at http://dxr.mozilla.org/mozilla-central/source/dom/mobilemessage/src/gonk/MobileMessageDB.jsm#2268.

If we add an onerror handler, then we get a ConstraintError.
When the error happens, the dumped threadRecord was:
> {"participantIds":[36],"participantAddresses":["0617980XXX"],"lastMessageId":2532,"lastTimestamp":1403015746146,"lastMessageSubject":null,"body":"Dgff","unreadCount":0,"lastMessageType":"sms"}

Vicamo, you added some code in bug 866938 to make this threadStore more strict, any idea what may trigger this condition ?
Flags: needinfo?(vyang)
Assignee: nobody → vyang
Component: General → RIL
Product: Core → Firefox OS
Version: Trunk → unspecified
Attached patch test caseSplinter Review
Hi, here is a test script for the case you described. I assume that's a MO message because its unreadCount is zero.  I can't really replicate the case you mentioned, and the structure doesn't seem to be causing ConstraintError for me.  I didn't make thread store more strict. Actually, the thread store schema was left untouched. Judging from the fact that most of us don't have messages with recipients of email addresses, the whole db was left untouched during upgradeSchema22, too.

I see the message id is pretty large.  Maybe you're working on some kind of regression tests?  Could you share with me some more details? ConstraintError must come from Gecko for sure.
Flags: needinfo?(vyang)
Flags: needinfo?(lissyx+mozillians)
Thanks for this explanation :). As I documented in the original comment, for now I've only been aboe to reproduce this on Janx' dogfooding Flame.

To answer your point, no, we are not working on regression tests but trying to find the root cause of the fact that Janx cannot send any SMS to anyone apart from people already in a SMS thread on his device.

Maybe Janx can share the SMS database to you.
Flags: needinfo?(vyang)
Flags: needinfo?(lissyx+mozillians)
Flags: needinfo?(janx)
The bug seemed to prevent me from adding new threads, i.e. sending messages to and receiving messages from new people.

Fortunately for me, but unfortunately for this bug, the problem has "magically" disappeared yesterday: I suddenly received all pending messages and can now send messages to new people. I didn't save a copy of my SMS database with the problem present, and I really don't know what made the problem go away (I didn't perform any changes on the device, only used it normally for a few days) and I don't have any logs. Sorry about that!
Flags: needinfo?(janx)
(In reply to Jan Keromnes [:janx] from comment #4)
> I didn't save a copy of my SMS
> database with the problem present, and I really don't know what made the
> problem go away (I didn't perform any changes on the device, only used it
> normally for a few days) and I don't have any logs. Sorry about that!

NP. I'm closing this bug as WORKSFORME. If you find it come back again, please just re-open it and let's see what can we do then.
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(vyang)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.