Closed
Bug 921919
Opened 11 years ago
Closed 11 years ago
B2G MMS: Notify Gaia SMS AP the MMS read report request and return the read result to the requester
Categories
(Firefox OS Graveyard :: RIL, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ctai, Assigned: ctai)
References
Details
(Keywords: dev-doc-needed)
Attachments
(1 file, 11 obsolete files)
43.81 KB,
patch
|
Details | Diff | Splinter Review |
As a receiver, FFOS is capable of returning MMS read report when the sender is requesting that.
Comment 1•11 years ago
|
||
IMO, we've already had markMessageRead() so we might not need new API.
Summary: B2G MMS: Notify Gaia SMS AP the MMS read report request when getting a MMS and open an API for return the result. → B2G MMS: Notify Gaia SMS AP the MMS read report request and return the read result to the requester
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → ctai
Assignee | ||
Comment 2•11 years ago
|
||
Per talk with Gene, we still need to add an arguments in |markMessageRead| if we don't want to add a new API.
Updated•11 years ago
|
blocking-b2g: --- → 1.3?
Assignee | ||
Comment 3•11 years ago
|
||
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #812935 -
Attachment is obsolete: true
Comment 5•11 years ago
|
||
This final decision in agreement is:
DOMRequest markMessageRead(in long id, in boolean value
[optional] in boolean sendReadReport);
When |value| == TRUE && |sendReadReport| == TRUE, it will send the read port back to the requester in addition to marking the message to be read in the DB. If the parameter is not indicated, the send will apply the global setting.
Assignee | ||
Comment 6•11 years ago
|
||
We still need one more attribute in nsIDOMMozMmsMessage.idl.
The attribute is:
readonly attribute boolean isReadReportRequested;
We need this attribute to let gaia developer know is it necessary to ask end user return read report or not.
Comment 7•11 years ago
|
||
Thanks for catching this! Nice!
Assignee | ||
Comment 8•11 years ago
|
||
Attachment #813424 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #821496 -
Flags: feedback?(vyang)
Comment 9•11 years ago
|
||
Comment on attachment 821496 [details] [diff] [review]
bug-921919.patch v1.2
Review of attachment 821496 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/mobilemessage/interfaces/nsIMmsService.idl
@@ +21,5 @@
> void retrieve(in long id,
> in nsIMobileMessageCallback request);
> +
> + void sendReadReport(in DOMString messageID,
> + in jsval to);
Please use DOMString here. Parse address type before sending read report out.
::: dom/mobilemessage/src/MobileMessageManager.cpp
@@ +357,5 @@
> NS_ENSURE_TRUE(mobileMessageDBService, NS_ERROR_FAILURE);
>
> nsRefPtr<DOMRequest> request = new DOMRequest(GetOwner());
> nsCOMPtr<nsIMobileMessageCallback> msgCallback = new MobileMessageCallback(request);
> + nsresult rv = mobileMessageDBService->MarkMessageRead(aId, aValue, aSendReadReport, msgCallback);
nit: line wrap
::: dom/mobilemessage/src/gonk/MmsService.js
@@ +1206,5 @@
> + // Mandatory fields
> + headers["x-mms-message-type"] = MMS.MMS_PDU_TYPE_READ_REC_IND;
> + headers["x-mms-mms-version"] = MMS.MMS_VERSION;
> + headers["message-id"] = messageID;
> + headers["to"] = to;
Parse |to| address here.
@@ +1335,5 @@
> intermediate.sender = "anonymous";
> }
> intermediate.receivers = [];
> intermediate.phoneNumber = this.getPhoneNumber();
> + intermediate.sentReadReport = false;
Don't assign a default value in |convertIntermediateToSavable|. It's for attributes critical to MobileMessageDatabaseService::saveReceivedMessage. And since it has a default value, it's certainly not critical. Please move this line into MobileMessageDatabaseService::saveReceivedMessage. Besides, please also rename it to |isReadReportSent|.
::: dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js
@@ +1140,5 @@
> + }
> +
> + let messageRecord = cursor.value;
> + if (messageRecord.type == "sms") {
> + messageRecord.sentReadReport = false;
Please update all "MMS" messages and set their 'isReadReportSent' attribute to false.
@@ +1208,5 @@
> expiryDate = aMessageRecord.timestamp + headers["x-mms-expiry"] * 1000;
> }
> + let readReport = false;
> + if (headers["x-mms-read-report"] != undefined) {
> + readReport = headers["x-mms-read-report"];
'isReadReportRequested', and you can have:
let isReadReportRequested = headers["x-mms-read-report"] || false;
@@ +1916,5 @@
> (aMessage.type == "mms" && (aMessage.delivery == undefined ||
> aMessage.transactionId == undefined ||
> !Array.isArray(aMessage.deliveryStatus) ||
> + !Array.isArray(aMessage.receivers) ||
> + aMessage.sentReadReport == undefined)) ||
You don't need it. Simply assign |aMessage.isReadReportSent| to false whenever it's a MMS.
@@ +2295,5 @@
> }
> messageRecord.read = value ? FILTER_READ_READ : FILTER_READ_UNREAD;
> messageRecord.readIndex = [messageRecord.read, messageRecord.timestamp];
> + if (messageRecord.type == "mms" && !messageRecord.sentReadReport &&
> + sendReadReport) {
if (sendReadReport &&
messageRecord.type == "mms" &&
messageRecord.read == FILTER_READ_READ &&
!messageRecord.isReadReportSend)
@@ +2299,5 @@
> + sendReadReport) {
> + messageRecord.sentReadReport = true;
> + let messageID = messageRecord.headers["message-id"];
> + let to = messageRecord.headers["from"];
> + gMMSService.sendReadReport(messageID, to);
Please queue these things up and really send read report in:
threadStore.put(threadRecord).onsuccess = function(event) {
Attachment #821496 -
Flags: feedback?(vyang)
Assignee | ||
Comment 10•11 years ago
|
||
Attachment #821496 -
Attachment is obsolete: true
Assignee | ||
Comment 11•11 years ago
|
||
Attachment #823178 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #823179 -
Flags: review?(vyang)
Comment 12•11 years ago
|
||
Comment on attachment 823179 [details] [diff] [review]
bug-921919.patch v1.4
Review of attachment 823179 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/mobilemessage/src/gonk/MmsService.js
@@ +1213,5 @@
> + headers["to"] = to;
> + headers["from"] = null;
> + headers["x-mms-read-status"] = true;
> +
> + this.istream = MMS.PduHelper.compose(null, {headers: headers});
throw |Cr.NS_ERROR_FAILURE| if |this.istream| is null and have a catch in MmsService::sendReadReport().
@@ +1222,5 @@
> + if (callback) {
> + requestCallback = function (httpStatus, data) {
> + callback(httpStatus);
> + };
> + }
ReadRecTransaction::run is always called without a callback function. So let skip this lines here.
@@ +2139,5 @@
>
> + sendReadReport: function sendReadReport(messageID, toAddress) {
> + if (DEBUG) debug("messageID: " + messageID + " toAddress: " + JSON.stringify(toAddress));
> + let readRecTransaction = new ReadRecTransaction(messageID, toAddress);
> + readRecTransaction.run();
try {
let transaction = new ReadRecTransaction(messageID, toAddress);
transaction.run();
} catch (e) {}
::: dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js
@@ +2292,5 @@
> }
> messageRecord.read = value ? FILTER_READ_READ : FILTER_READ_UNREAD;
> messageRecord.readIndex = [messageRecord.read, messageRecord.timestamp];
> + let sendReadReportArguments = null;
> + if (sendReadReport &&
nit: trailing ws
Attachment #823179 -
Flags: review?(vyang) → review+
Assignee | ||
Comment 13•11 years ago
|
||
Fixed according to vyang's comments.
Attachment #823179 -
Attachment is obsolete: true
Updated•11 years ago
|
Keywords: dev-doc-needed
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 16•11 years ago
|
||
Remove empty line.
Attachment #825754 -
Attachment is obsolete: true
Comment 17•11 years ago
|
||
This has a lot of merge conflicts with b2g-inbound. What branch are you rebasing on top of?
Keywords: checkin-needed
Assignee | ||
Comment 18•11 years ago
|
||
Hi, Ryan,
I used b2g-inbound, but bug 887159 landed quicker than me.
I will rebase again.
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #17)
> This has a lot of merge conflicts with b2g-inbound. What branch are you
> rebasing on top of?
Assignee | ||
Comment 19•11 years ago
|
||
Rebased on top of bug 866938 and bug 887159.
Attachment #825784 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #826582 -
Flags: review?(vyang)
Comment 20•11 years ago
|
||
Comment on attachment 826582 [details] [diff] [review]
bug-921919.patch v1.9
Review of attachment 826582 [details] [diff] [review]:
-----------------------------------------------------------------
Sorry, found some more things to be fixed before landing.
::: dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js
@@ +237,4 @@
> self.upgradeSchema15(event.target.transaction, next);
> break;
> case 16:
> + if (DEBUG) debug("Upgrade to version 17. Add sentReadReport for incoming MMS.");
nit: isReadReportSent
@@ +1079,5 @@
> };
> },
>
> + /**
> + * Add sentReadReport for incoming MMS.
ditto
@@ +2138,5 @@
> + messageRecord.isReadReportSend = true;
> + let messageID = messageRecord.headers["message-id"];
> + let to = messageRecord.headers["from"];
> + sendReadReportArguments = {messageID: messageID,
> + toAddress : to.address}
Both MESSAGE-ID and FROM could be null because the former is a conditional parameter and the latter is an optional one. Besides, we should have some more strict conditions that we should only send READ REPORT to retrieved MMS messages.
Attachment #826582 -
Flags: review?(vyang)
Assignee | ||
Updated•11 years ago
|
Attachment #826611 -
Flags: review?(vyang)
Updated•11 years ago
|
Attachment #826611 -
Flags: review?(vyang) → review+
Comment 22•11 years ago
|
||
Updated•11 years ago
|
Component: DOM: Device Interfaces → RIL
Product: Core → Firefox OS
Assignee | ||
Comment 23•11 years ago
|
||
My bad, Backed out...
https://hg.mozilla.org/try/rev/b95c97c9617d
Full try:
https://tbpl.mozilla.org/?tree=Try&rev=1bd9c1f61911
Assignee | ||
Comment 24•11 years ago
|
||
Attachment #826611 -
Attachment is obsolete: true
Comment 25•11 years ago
|
||
i had to back this out from b2g-inbound for build failure like https://tbpl.mozilla.org/php/getParsedLog.php?id=30064881&tree=B2g-Inbound
Assignee | ||
Comment 26•11 years ago
|
||
Thanks, sorry for the build failure.
(In reply to Carsten Book [:Tomcat] from comment #25)
> i had to back this out from b2g-inbound for build failure like
> https://tbpl.mozilla.org/php/getParsedLog.php?id=30064881&tree=B2g-Inbound
Comment 27•11 years ago
|
||
Comment 28•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment 29•11 years ago
|
||
Although we've already had full discussions about the API changes to support read report, technically, we still need supuerreview+ before landing when it comes to DOM API changes. No worries. Just a reminder. :)
Assignee | ||
Comment 30•11 years ago
|
||
Thanks for reminder. Will be more careful next time. :)
(In reply to Gene Lian [:gene] (needinfo? encouraged) from comment #29)
> Although we've already had full discussions about the API changes to support
> read report, technically, we still need supuerreview+ before landing when it
> comes to DOM API changes. No worries. Just a reminder. :)
Comment 31•11 years ago
|
||
This landed before gecko 28 branched so will be in 1.3.
blocking-b2g: 1.3? → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•