Closed Bug 810097 Opened 12 years ago Closed 11 years ago

B2G MMS: Retry retrieval on error

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22
blocking-b2g leo+
Tracking Status
firefox20 --- wontfix
firefox21 --- wontfix
firefox22 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix

People

(Reporter: vicamo, Assigned: ctai)

References

Details

(Keywords: feature)

Attachments

(2 files, 6 obsolete files)

See also bug 810067 for retrieval mode and bug 810091 for duplicated notification.
Blocks: b2g-mms, 804679
No longer blocks: 804679
Depends on: 810067
Blocks: 840066
blocking-b2g: --- → leo?
blocking-b2g: leo? → leo+
Keywords: feature
Assignee: nobody → ctai
Attached patch Retry Retrieval (obsolete) — Splinter Review
Attached patch Retry Retrieval (obsolete) — Splinter Review
Attachment #718277 - Attachment is obsolete: true
Attachment #718278 - Flags: feedback?(vyang)
Comment on attachment 718278 [details] [diff] [review]
Retry Retrieval

Review of attachment 718278 [details] [diff] [review]:
-----------------------------------------------------------------

Let's hide retrial in RetrieveTransaction::run(). Have something like:

RetrieveTransaction::run(callback) {
  this.retryCount = 0;
  this.retrieve(function (mmsStatus, msg) {
    if (mmsStatus == MMS.MMS_PDU_STATUS_DEFERRED &&
        this.retryCount < MAX_RETRY_COUNT) {
      this.retryCount++;
      let self = arguments.callee;
      new timer(ONE_SHOT, function () {
        this.retrieve(self);
      });
      return;
    }

    if (callback) {
      callback
    }
  });
}

RetrieveTransaction::retrieve(callback) {
  // original run()
}
Attachment #718278 - Flags: feedback?(vyang)
Attached patch Retry Retrieval (obsolete) — Splinter Review
Attachment #718278 - Attachment is obsolete: true
Attached patch Retry Retrieval (obsolete) — Splinter Review
Attachment #718318 - Attachment is obsolete: true
Attachment #718319 - Flags: feedback?(vyang)
Comment on attachment 718319 [details] [diff] [review]
Retry Retrieval

Review of attachment 718319 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/mms/src/ril/MmsService.js
@@ +39,5 @@
>  const RETRIEVAL_MODE_AUTOMATIC = "automatic";
>  const RETRIEVAL_MODE_NEVER = "never";
>  
> +const MAX_RETRY_COUNT = 3;
> +const DELAY_TIME_TO_RETRY = 5000;

How about "dom.mms.retrievalRetryCount", "dom.mms.retrievalRetryInterval"?

@@ +504,5 @@
> +    }).bind(this));
> +  },
> +
> +  /**
> +   * @param callback [optional]

That's not optional now.

@@ +511,5 @@
> +   */
> +  retrieve: function retrieve(callback) {
> +    let callbackIfValid = function callbackIfValid(mmsStatus, msg) {
> +      if (callback) {
> +        callback(mmsStatus, msg);

ditto.
Attachment #718319 - Flags: feedback?(vyang)
Attached patch Retry RetrievalSplinter Review
Attachment #718319 - Attachment is obsolete: true
Attachment #718326 - Flags: review?(vyang)
Comment on attachment 718326 [details] [diff] [review]
Retry Retrieval

Review of attachment 718326 [details] [diff] [review]:
-----------------------------------------------------------------

Thank you :)
Attachment #718326 - Flags: review?(vyang) → review+
Attached patch Retry for TransientError (obsolete) — Splinter Review
Attachment #718834 - Attachment is obsolete: true
Comment on attachment 718836 [details] [diff] [review]
Retry for TransientError

It is not necessary.
Attachment #718836 - Attachment is obsolete: true
Comment on attachment 718836 [details] [diff] [review]
Retry for TransientError

Review of attachment 718836 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/mms/src/ril/MmsService.js
@@ +498,5 @@
> +    this.retryCount = 0;
> +    let that = this;
> +    this.retrieve((function retryCallback(mmsStatus, msg) {
> +      if ((MMS.MMS_PDU_STATUS_DEFERRED == mmsStatus ||
> +          gMmsTransactionHelper.isTransientError(mmsStatus)) &&

We don't need this. It's already a X-Mms-Status. Just check whether does it equals to MMS.MMS_PDU_STATUS_DEFERRED is sufficient. Therefore, we don't need isTransientError(), either.

@@ -818,5 @@
>          debug("retrievedMsg = " + JSON.stringify(retrievedMsg));
> -        if (this.isTransientError(mmsStatus)) {
> -          // TODO: remove this check after bug 810097 is landed.
> -          return;
> -        }

Removing code here should have done, but just upload a follow-up instead.
Attachment #718836 - Attachment is obsolete: false
Attachment #718836 - Flags: review-
Attachment #718836 - Attachment is obsolete: true
Attachment #718841 - Flags: review?(vyang)
Attachment #718841 - Flags: review?(vyang) → review+
https://hg.mozilla.org/mozilla-central/rev/931ad73babc6
https://hg.mozilla.org/mozilla-central/rev/b082c2abd269
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Flags: in-moztrap-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: