Closed Bug 935873 Opened 11 years ago Closed 11 years ago

MMS retry should handle modified input stream

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
1.3 Sprint 5 - 11/22

People

(Reporter: skao, Assigned: skao)

References

Details

Attachments

(2 files, 8 obsolete files)

Sometimes when xhr failed the size of input stream get smaller, should do something to re-construct the complete input stream.
Assignee: nobody → skao
Blocks: 931699
Attached patch bug935873.patch (obsolete) — Splinter Review
Attachment #828544 - Flags: review?(gene.lian)
Gene,

I found that after compose, the part.content type will change to normal byte array. Could you have a look to check if this fix is feasible? Thanks!

Also I changed the retry time for the first retry to 3 seconds (where the default one is 300 seconds). And this can solve our resend issue as a work around.
Comment on attachment 828544 [details] [diff] [review]
bug935873.patch

Basically, we cannot change preference at will, which is for verdor's configurations. I'd prefer delegating this review to Vicamo.
Attachment #828544 - Flags: review?(vyang)
Attachment #828544 - Flags: review?(gene.lian)
Attachment #828544 - Flags: review-
I didn't get it? I only change the first retry period, the following retries would follow the preference as well.
summary short discussion with Vicamo:

1. should split the 3 seconds work around into another patch/bug
2. find out where part.content get modified and not to modify it
3. have a test case to make sure part.content won't get modified after compose
Comment on attachment 828544 [details] [diff] [review]
bug935873.patch

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

For TIME_FOR_FIRST_RETRY thing, that's not belong to this bug.  I think we can all agree that Gecko shall not produce surprises to Gaia by changing user preferences at will.

::: dom/mobilemessage/src/gonk/MmsService.js
@@ +1206,5 @@
> +          // we have to re-compose it.
> +          if (this.istreamSize == null ||
> +              this.istreamSize != this.istream.available()) {
> +            this.istream = MMS.PduHelper.compose(null, this.msg);
> +            this.istreamSize = this.istream.available();

Shouldn't we have the same |this.istreamSize|?

::: dom/mobilemessage/src/gonk/WspPduHelper.jsm
@@ +2455,4 @@
>          }
>          part.content = this.encodeStringContent(part.content, charset);
>          UintVar.encode(data, part.content.length);
> +      } else if (part.content.length != null) {

I'd like to know which line overrides |part.content| and re-evaluates its necessity.  Keeping |msg| unchanged throughout the PDU composing process might help us in further problems.

Besides, there is a xpcshell test script "dom/mobilemessage/tests/test_wsp_pdu_helper.js" for this jsm.  Please also add a test case for this. :)
Attachment #828544 - Flags: review?(vyang)
Blocks: 937013
Attached patch bug935873.patch (obsolete) — Splinter Review
Hi Vicamo,

I'll upload another patch once the tests finished, Thanks!
Attachment #828544 - Attachment is obsolete: true
Attachment #830075 - Flags: review?(vyang)
Attachment #830075 - Flags: review?(vyang) → review+
Attached patch bug935873.patch (obsolete) — Splinter Review
Attachment #830075 - Attachment is obsolete: true
Attached patch bug935873.patch (obsolete) — Splinter Review
Attachment #830640 - Attachment is obsolete: true
Attachment #830642 - Flags: review?(vyang)
Hi Vicamo,

I accidentally removed the re-compose part from the patch, could you help to review it again?
Thanks!
Just a drive-by review. nit: s/the input stream.../The input stream.../

Comment should follow: // {upper-case-letter}...{a period}.
Btw, if you've already got review then don't need to ask for review again until you have extra changes.
Yes, there are extra changes. I missed re-compose part in previous patches!
Attached patch bug935873_test.patch (obsolete) — Splinter Review
Attached patch bug935873.patch (obsolete) — Splinter Review
fixed the nit Gene mentioned.
Attachment #830642 - Attachment is obsolete: true
Attachment #830642 - Flags: review?(vyang)
Attachment #830721 - Flags: review?(vyang)
Comment on attachment 830721 [details] [diff] [review]
bug935873.patch

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

r=me, and just a remind: https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3F
Attachment #830721 - Flags: review?(vyang) → review+
Attached patch bug935873_test.patch (obsolete) — Splinter Review
Attachment #830716 - Attachment is obsolete: true
Attachment #831314 - Flags: review?(vyang)
Comment on attachment 831314 [details] [diff] [review]
bug935873_test.patch

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

::: dom/mobilemessage/tests/test_wsp_pdu_helper.js
@@ +1353,5 @@
> +  let afterCompose = JSON.stringify(parts);
> +
> +  if (beforeCompose !== afterCompose) {
> +    do_throw("expect value: '" + beforeCompose + "', got '" + afterCompose + "'");
> +  }

nit: do_check_eq(beforeCompose, afterCompose);

I also find this might come from "dom/mobilemessage/tests/header_helpers.js:function wsp_test_func".  Please help update that as well.
Attachment #831314 - Flags: review?(vyang) → review+
Attached patch bug935873_test.patch (obsolete) — Splinter Review
fixed nits, will upload final patches for check-in soon.
Attachment #831314 - Attachment is obsolete: true
Attachment #831386 - Flags: review+
Attachment #830721 - Attachment is obsolete: true
Attachment #831403 - Flags: review+
Attachment #831386 - Attachment is obsolete: true
Attachment #831405 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/20f754fcefb5
https://hg.mozilla.org/mozilla-central/rev/1a9bf903a453
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → 1.3 Sprint 5 - 11/22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: