Closed
Bug 863241
Opened 12 years ago
Closed 11 years ago
B2G MMS: the return items from getThreads should have type to identify mms or sms.
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
People
(Reporter: ctai, Assigned: ctai)
References
Details
(Whiteboard: [INTERFACE_CHANGE])
Attachments
(4 files, 9 obsolete files)
(deleted),
patch
|
vicamo
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
airpingu
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Updated•12 years ago
|
Summary: B2G MMS: the return items from getThread should have type to identify mms or sms. → B2G MMS: the return items from getThreads should have type to identify mms or sms.
Assignee | ||
Updated•12 years ago
|
Assignee | ||
Updated•12 years ago
|
Whiteboard: [NO_UPLIFT]
Assignee | ||
Comment 1•12 years ago
|
||
This bug blocks leo+ bug(862311). So nominate to leo+.
blocking-b2g: --- → leo?
Whiteboard: [NO_UPLIFT] → [NO_UPLIFT], [INTERFACE_CHANGE]
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → ctai
Assignee | ||
Comment 2•12 years ago
|
||
Assignee | ||
Comment 3•12 years ago
|
||
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #742253 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Attachment #742254 -
Flags: feedback?(vyang)
Assignee | ||
Updated•12 years ago
|
Attachment #742258 -
Flags: feedback?(vyang)
Comment 5•12 years ago
|
||
Triage 4/29 - leo+ as part of required MMS feature.
blocking-b2g: leo? → leo+
Updated•12 years ago
|
Attachment #742258 -
Flags: feedback?(vyang) → feedback+
Comment 6•12 years ago
|
||
Comment on attachment 742254 [details] [diff] [review]
Part 2/2: Patch v1.0
Review of attachment 742254 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/mms/src/ril/MmsService.js
@@ +1184,5 @@
> let retrievalMode = RETRIEVAL_MODE_MANUAL;
> try {
> retrievalMode = Services.prefs.getCharPref(PREF_RETRIEVAL_MODE);
> } catch (e) {}
> + debug("retrievalMode = " + retrievalMode);
nit: debug code
::: dom/mobilemessage/src/ril/MobileMessageDatabaseService.js
@@ +626,5 @@
>
> + upgradeSchema10: function upgradeSchema10(transaction) {
> + let threadStore = transaction.objectStore(THREAD_STORE_NAME);
> +
> + // Populate threadStore.
"Add 'lastMessageType' to each thread record."
Attachment #742254 -
Flags: feedback?(vyang) → feedback+
Assignee | ||
Comment 7•12 years ago
|
||
Attachment #742254 -
Attachment is obsolete: true
Assignee | ||
Comment 8•12 years ago
|
||
Attachment #743130 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Attachment #742258 -
Flags: review?(vyang)
Assignee | ||
Updated•12 years ago
|
Attachment #743131 -
Flags: review?(vyang)
Assignee | ||
Updated•12 years ago
|
Attachment #743131 -
Flags: review?
Assignee | ||
Updated•12 years ago
|
Attachment #743131 -
Flags: review?
Assignee | ||
Comment 9•12 years ago
|
||
Changed according to comment 6.
(In reply to Chia-hung Tai [:ctai :ctai_mozilla :cht] from comment #8)
> Created attachment 743131 [details] [diff] [review]
> Part 2/2: Patch v1.2
Assignee | ||
Comment 10•12 years ago
|
||
Comment on attachment 742258 [details] [diff] [review]
Part 1/2: Interface v1.1
We need to change the DOM interface nsIDOMMozMobileMessageThread, because we need a variable to tell the last message is sms or mms. Those changes need a superreview for DOM api change.
Attachment #742258 -
Flags: superreview?(mounir)
Comment 11•12 years ago
|
||
Thanks for letting us know, we will incorporate this change in commercial RIL shortly.
Whiteboard: [NO_UPLIFT], [INTERFACE_CHANGE] → [INTERFACE_CHANGE]
Updated•12 years ago
|
Attachment #742258 -
Flags: review?(vyang)
Attachment #742258 -
Flags: review+
Attachment #742258 -
Flags: feedback+
Comment 12•12 years ago
|
||
Comment on attachment 743131 [details] [diff] [review]
Part 2/2: Patch v1.2
Review of attachment 743131 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/mobilemessage/src/ril/MobileMessageDatabaseService.js
@@ +631,5 @@
> + threadStore.openCursor().onsuccess = function(event) {
> + let cursor = event.target.result;
> + if (!cursor) {
> + return;
> + }
nit: add a new line.
@@ +994,5 @@
> }
>
> + if (aMessageRecord.type !== threadRecord.lastMessageType) {
> + threadRecord.lastMessageType = aMessageRecord.type;
> + needsUpdate = true;
No. Please move this |lastMessageType| assignment into |if (threadRecord.lastTimestamp <= timestamp) {| block. We don't update thread record unless the adding message becomes the last one in the thread.
Attachment #743131 -
Flags: review?(vyang) → review-
Comment 13•12 years ago
|
||
Comment on attachment 742258 [details] [diff] [review]
Part 1/2: Interface v1.1
Review of attachment 742258 [details] [diff] [review]:
-----------------------------------------------------------------
It's not clear to me how this is going to make things in bug 862311 better. The idea is to show an attachment icon when the message has an attachment but MMS don't always have an attachment in the user perspective.
Attachment #742258 -
Flags: superreview?(mounir) → superreview-
Assignee | ||
Comment 14•12 years ago
|
||
Attachment #743131 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Attachment #744154 -
Flags: review?(vyang)
Assignee | ||
Comment 15•12 years ago
|
||
Add new line and move |lastMessageType| assignment into |if (threadRecord.lastTimestamp <= timestamp) {| block.
(In reply to Chia-hung Tai [:ctai :ctai_mozilla :cht] from comment #14)
> Created attachment 744154 [details] [diff] [review]
> Part 2/2: Patch v1.3
Comment 16•12 years ago
|
||
(In reply to Mounir Lamouri (:mounir) from comment #13)
> Comment on attachment 742258 [details] [diff] [review]
> Part 1/2: Interface v1.1
>
> Review of attachment 742258 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> It's not clear to me how this is going to make things in bug 862311 better.
> The idea is to show an attachment icon when the message has an attachment
> but MMS don't always have an attachment in the user perspective.
Yes, it's not ideal, but that's what we're shipping in 1.1. All the product stakeholders and UX have agreed to this, so it's not a valid reason to r- this patch.
We should try and make things better in 1.2, but paperclip-even-for-multi-chunk-text-messages approach is agreed upon to be enough to ship for 1.1.
Comment 17•12 years ago
|
||
Comment on attachment 744154 [details] [diff] [review]
Part 2/2: Patch v1.3
Review of attachment 744154 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/mobilemessage/src/ril/MobileMessageDatabaseService.js
@@ +987,5 @@
> threadRecord.subject = aMessageRecord.body;
> threadRecord.lastMessageId = aMessageRecord.id;
> + if (aMessageRecord.type !== threadRecord.lastMessageType) {
> + threadRecord.lastMessageType = aMessageRecord.type;
> + }
nit: you don't really have to compare them first. Just assign it.
Attachment #744154 -
Flags: review?(vyang) → review+
Comment 18•12 years ago
|
||
(In reply to Dietrich Ayala (:dietrich) from comment #16)
> Yes, it's not ideal, but that's what we're shipping in 1.1. All the product
> stakeholders and UX have agreed to this, so it's not a valid reason to r-
> this patch.
I'm not sure why UX and product decisions are not allowed to be discussed: showing an attachment indication in the thread view when the message has actually no attachment seems worse than not showing the indication in the thread view. I do not understand why showing that icon is so important that we are okay to show it even when it should not appear.
For the moment, the only answer I got in the other bug is that MMS must have an attachment but if this can be true for sent ones, it isn't for received ones.
Why don't we add something that says if the last message has an attachment instead of giving the type of the last message?
Comment 19•12 years ago
|
||
Of course they are allowed to be discussed - it was discussed by the MMS devs and the product team and UX team long ago. Unfortunately not everyone can be in every discussion.
The important point is let's land this initial basic support and indicator first, and file a follow-up for further changes.
Assignee | ||
Comment 20•12 years ago
|
||
Attachment #744154 -
Attachment is obsolete: true
Assignee | ||
Comment 21•12 years ago
|
||
Assign lastMessageType directly.
(In reply to Chia-hung Tai [:ctai :ctai_mozilla :cht] from comment #20)
> Created attachment 744661 [details] [diff] [review]
> Part 2/2: Patch v1.4
Assignee | ||
Comment 22•12 years ago
|
||
I just file a bug 868031 - B2G MMS: Find a better data structure for nsIDOMMozMobileMessageThread.
Would you mind to discuss this issue in this bug?
Comment 23•12 years ago
|
||
Mounir, the paperclip tells the user that it's an MMS, which may cost money. Yes, it's not awesome. In the future we can come with some other way to indicate it's an SMS-that's-only-MMS-because-it's-too-long, but this should do that purpose for 1.1.
Assignee | ||
Comment 24•12 years ago
|
||
Comment on attachment 742258 [details] [diff] [review]
Part 1/2: Interface v1.1
Could you please help to review this patch?
Thanks.
Attachment #742258 -
Flags: superreview- → superreview?(mounir)
Comment 25•12 years ago
|
||
Comment on attachment 742258 [details] [diff] [review]
Part 1/2: Interface v1.1
Review of attachment 742258 [details] [diff] [review]:
-----------------------------------------------------------------
sr- for two reasons:
1. Passing a string that whether provide "sms" or "mms" instead of an enum is a waste of memory and CPU time (in the ipdlh);
2. No one answered my suggestion about having a .hasAttachment boolean instead of a .lastMessageType string. .hasAttachment is the API you actually want, right?
Attachment #742258 -
Flags: superreview?(mounir) → superreview-
Assignee | ||
Comment 26•12 years ago
|
||
Attachment #742258 -
Attachment is obsolete: true
Assignee | ||
Comment 27•12 years ago
|
||
Attachment #744661 -
Attachment is obsolete: true
Assignee | ||
Comment 28•12 years ago
|
||
Comment on attachment 745317 [details] [diff] [review]
Part 2/2: Patch v1.5
Rebased and change lastMessageType into enum.
Attachment #745317 -
Flags: review?(vyang)
Assignee | ||
Comment 29•12 years ago
|
||
Comment on attachment 745316 [details] [diff] [review]
Part 1/2: Interface v1.2
Rebased and change lastMessageType into enum.
Attachment #745316 -
Flags: superreview?(mounir)
Attachment #745316 -
Flags: review?(vyang)
Assignee | ||
Comment 30•12 years ago
|
||
Vicamo, could you please help to review it again?
Because I change the lastMessageType into enum.
Thanks.
(In reply to Chia-hung Tai [:ctai :ctai_mozilla :cht] from comment #28)
> Comment on attachment 745317 [details] [diff] [review]
> Part 2/2: Patch v1.5
>
> Rebased and change lastMessageType into enum.
Assignee | ||
Comment 31•12 years ago
|
||
Mounir, thanks for your suggestion about having a .hasAttachment boolean instead of a .lastMessageType string. But we don't do that because of it can't be done in a short time. This bug blocks thread view list, and thread view list should be landed ASAP. The reason of why change to hasAttachment will take a lot of time is the design of DB for SMS and MMS. MMS pdu has a structure called multi-parts. Currently we take each part in multi-parts to Blob, even it is a plain-text. So in DB related code, we don't know this message is text only or with attachments. Sure we can know by adding more codes. But it takes time (coding, debuging, reviewing....) and we have the attribute called type in the message record. When saving the message into DB, it also saves thread related information as a thread record. Then the getThread function try to get the thread result to Messaging AP. If we want to support hasAttachment, it also means we need to deal with below situations.
1. MMS message, only has subject.
2. MMS message, has subject and text.
3. MMS message, has subject and text and attachments.
4. MMS message, no subject but has text.
5. MMS message, no subject but has text and attachments.
6. SMS message, have text.
We need to find out this MMS message has real attachments(not only one text attachment).
And also need to know the subject exist or not. Also the text need to replace the body in thread record. It definitely takes more time to let it happen.
Another way is provide the whole message from the nsIDOMMozMobileMessageThread. I mean pass nsIDOMMozMmsMessage through ipc to Messagign AP. It means pass the all blob of last image (it might be an image, a video...) for each thread. I don't think it is a good idea.
So could we use lastMessageType in this bug and find a better solution in another bug 868031 I filed? This solution came from Madrid work week. Vicamo, gene and I discussed with UX team(Ayman). We know it is not a perfect solution, but it accepted by UX team. Once this bug is land, then Messaging AP developers can land their thread view bugs in a short time. They already have WIP patches.
Please feel free to ping me.Thanks.
(In reply to Mounir Lamouri (:mounir) from comment #25)
> Comment on attachment 742258 [details] [diff] [review]
> Part 1/2: Interface v1.1
>
> Review of attachment 742258 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> sr- for two reasons:
> 1. Passing a string that whether provide "sms" or "mms" instead of an enum
> is a waste of memory and CPU time (in the ipdlh);
> 2. No one answered my suggestion about having a .hasAttachment boolean
> instead of a .lastMessageType string. .hasAttachment is the API you actually
> want, right?
Comment 32•11 years ago
|
||
Comment on attachment 745317 [details] [diff] [review]
Part 2/2: Patch v1.5
Review of attachment 745317 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/mobilemessage/src/Constants.h
@@ +40,5 @@
> #define MESSAGE_CLASS_CLASS_2 NS_LITERAL_STRING("class-2")
> #define MESSAGE_CLASS_CLASS_3 NS_LITERAL_STRING("class-3")
>
> +#define MESSAGE_SMS NS_LITERAL_STRING("sms")
> +#define MESSAGE_MMS NS_LITERAL_STRING("mms")
MESSAGE_TYPE_foo please.
::: dom/mobilemessage/src/MobileMessageThread.cpp
@@ +187,5 @@
> + case eDeliveryState_Unknown:
> + case eDeliveryState_EndGuard:
> + default:
> + MOZ_NOT_REACHED("We shouldn't get any other delivery state!");
> + return NS_ERROR_UNEXPECTED;
nit: alignment.
Attachment #745317 -
Flags: review?(vyang) → review+
Updated•11 years ago
|
Attachment #745316 -
Flags: review?(vyang) → review+
Assignee | ||
Comment 33•11 years ago
|
||
Revised according to comment 32.
Attachment #745317 -
Attachment is obsolete: true
Comment 34•11 years ago
|
||
Comment on attachment 745316 [details] [diff] [review]
Part 1/2: Interface v1.2
Review of attachment 745316 [details] [diff] [review]:
-----------------------------------------------------------------
I wasn't clear with .hasAttachment. I meant that this attribute could be implemented exactly like you are implementing the .lastMessageType but you could improve the implementation later. However, I feel like I might be wasting everybody's time here so feel free to land this as-is.
Attachment #745316 -
Flags: superreview?(mounir)
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 35•11 years ago
|
||
Mounir, thanks for your suggestion. We will change the name if we are implementing it as having attachment. We need more discussion for this implementation.
Comment 36•11 years ago
|
||
https://hg.mozilla.org/projects/birch/rev/76107e8b0df9
https://hg.mozilla.org/projects/birch/rev/db79b5ea167b
Keywords: checkin-needed
Assignee | ||
Comment 37•11 years ago
|
||
Attachment #745927 -
Attachment is obsolete: true
Comment 38•11 years ago
|
||
Pushed the interdiff between v1.6 and v1.7 to fix the Werror bustage.
https://hg.mozilla.org/projects/birch/rev/9ba22af0a840
Comment 39•11 years ago
|
||
Assignee | ||
Comment 40•11 years ago
|
||
Thanks!
(In reply to Ryan VanderMeulen [:RyanVM] from comment #39)
> *sigh*
> https://hg.mozilla.org/projects/birch/rev/415c369420a9
Comment 41•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/76107e8b0df9
https://hg.mozilla.org/mozilla-central/rev/415c369420a9
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Comment 42•11 years ago
|
||
Part 2 needs a b2g18-specific patch.
Assignee | ||
Comment 43•11 years ago
|
||
Assignee | ||
Comment 44•11 years ago
|
||
Ryan, I put the b2g18-specific patch. Thanks.
Flags: needinfo?(ryanvm)
Comment 45•11 years ago
|
||
https://hg.mozilla.org/releases/mozilla-b2g18/rev/7aab895899c3
https://hg.mozilla.org/releases/mozilla-b2g18/rev/bba0f27a1c1f
status-b2g18:
--- → fixed
status-b2g18-v1.0.0:
--- → wontfix
status-b2g18-v1.0.1:
--- → wontfix
status-firefox21:
--- → wontfix
status-firefox22:
--- → wontfix
status-firefox23:
--- → fixed
Flags: needinfo?(ryanvm)
Updated•11 years ago
|
Flags: in-moztrap-
Comment 46•11 years ago
|
||
Comment on attachment 746496 [details] [diff] [review]
Part 2/2: Patch v1.7
Review of attachment 746496 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/mobilemessage/src/ril/MobileMessageDatabaseService.js
@@ +662,5 @@
> + debug("Caught error on transaction", event.target.errorCode);
> + }
> + }
> + };
> + cursor.continue();
One defect here. Please see bug 887701, comment #30.
Comment 47•11 years ago
|
||
Hi Ctai, would you mind reopening this bug to come up with a follow-up patch for solving a potential issue at bug 887701, comment #30?
Flags: needinfo?(ctai)
Assignee | ||
Comment 48•11 years ago
|
||
Flags: needinfo?(ctai)
Assignee | ||
Comment 49•11 years ago
|
||
According comment 47, reopen it.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Updated•11 years ago
|
Attachment #778240 -
Flags: review?(gene.lian)
Comment 50•11 years ago
|
||
Comment on attachment 778240 [details] [diff] [review]
bug-863241-follow-up
Review of attachment 778240 [details] [diff] [review]:
-----------------------------------------------------------------
Great! Thank you!
Attachment #778240 -
Flags: review?(gene.lian) → review+
Comment 51•11 years ago
|
||
Not to be a process stickler, but let's try to avoid reopening bugs, especially ones that are more than 2 months old. Can you file a followup instead and land the patch there?
Assignee | ||
Comment 52•11 years ago
|
||
File a follow-up bug 895735.
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•11 years ago
|
Whiteboard: [INTERFACE_CHANGE]
Assignee | ||
Updated•11 years ago
|
Whiteboard: [INTERFACE_CHANGE]
You need to log in
before you can comment on or make changes to this bug.
Description
•