Closed Bug 965305 Opened 10 years ago Closed 10 years ago

[Cost Control] Resetting wi-fi usage from Cost Control app does not always reset to 0 B

Categories

(Firefox OS Graveyard :: Gaia::Cost Control, defect)

x86
macOS
defect
Not set
normal

Tracking

(blocking-b2g:1.3+, firefox28 wontfix, firefox29 wontfix, firefox30 fixed, b2g-v1.3 fixed, b2g-v1.3T fixed, b2g-v1.4 fixed)

RESOLVED FIXED
1.4 S1 (14feb)
blocking-b2g 1.3+
Tracking Status
firefox28 --- wontfix
firefox29 --- wontfix
firefox30 --- fixed
b2g-v1.3 --- fixed
b2g-v1.3T --- fixed
b2g-v1.4 --- fixed

People

(Reporter: bsilverberg, Assigned: albert)

References

Details

(Keywords: qablocker, regression, Whiteboard: [fromAutomation][gaia-ui-test])

Attachments

(3 files, 2 obsolete files)

This reproduces frequently in our automated test, and also intermittently manually.

STR:

1. Connect to wi-fi.
2. Open cost control and configure it to monitor wi-fi usage.
3. Open browser and visit a site (i.e., http://mozqa.com/data/firefox/layout/mozilla.html).
4. Disconnect wi-fi.
5. Open cost control and observe values. Wi-fi usage will be as expected (in the case of the test, approx. 2.8 MB).
6. Go to Cost Control Settings and reset wi-fi usage. Observe new value for wi-fi usage.

Expected result: View 0 B in step 6.
Actual result: View a small amount in step 6 (e.g., in the test, approx. 7.7 KB)

Tested on a Hamachi:
Gaia      b0aa74619cffb7a39ee0e7da5e9361a98e69f3f6
Gecko     http://hg.mozilla.org/releases/mozilla-aurora/rev/7d1173c4b173
BuildID   20140129004052
Version   28.0a2
Blocks: 965318
We really shouldn't be breaking these type of things this late in the game.
blocking-b2g: --- → 1.3?
blocking-b2g: 1.3? → 1.3+
QA Contact: pbylenga
It is probably not a Cost Control issue but an interface issue. Please, notice switching off Wi-Fi does not take place immediately. Anyway, asking Albert for back-end clarifications.

Albert, can you shed some light about this behavior?
Flags: needinfo?(acperez)
This issue has an average reproducibility rate of 20% or 1/5 attempts.

Regression window is 11-26-2013 to 11-27-2013.  On 11-26-2013 is the last build where we see bug 942060 which blocks reproducing the current issue.  On builds before the regression window found in 942060, I was not able to reproduce the issue.

Last build issue did not reproduce:
v1.3 Environmental Variables:
Device: Buri v1.3 MOZ
BuildID: 20131126052050
Gaia: 4ad796b196d468bdb231beba4392acbc90a74e96
Gecko: 99479edbee2a
Version: 28.0a1
Firmware Version: v1.2-device.cfg

First build issue reproduces:
v1.3 Environmental Variables:
Device: Buri v1.3 MOZ
BuildID: 20131127040203
Gaia: d4b9a3d271f0451b4d903a03c2b931b8cc092041
Gecko: 6ecf0c4dfcbe
Version: 28.0a1
Firmware Version: v1.2-device.cfg
This log is from the 11-27-2013 nightly Buri v1.3 build I mentioned in the previous comment.

This log covers these STRs
1. After browser activity disable WiFi in Settings
2. Launch Usage App
3. Enabled wifi on graph
4. Navigate to Usage Settings
5. Tap Reset

Actual results: data flashes but remains the same
Expected results: data is reset to 0


It should be noted that on later builds the actual results I observed were closer to what reporter recorded in Comment 0.
Whiteboard: [fromAutomation][gaia-ui-test] → [fromAutomation][gaia-ui-test][status:waiting on albert's input]
(In reply to Salvador de la Puente González [:salva] from comment #3)
> It is probably not a Cost Control issue but an interface issue. Please,
> notice switching off Wi-Fi does not take place immediately. Anyway, asking
> Albert for back-end clarifications.
> 
> Albert, can you shed some light about this behavior?

It is a back-end bug, because stats are not updated before doing the reset.
Flags: needinfo?(acperez)
Assignee: nobody → acperez
Whiteboard: [fromAutomation][gaia-ui-test][status:waiting on albert's input] → [fromAutomation][gaia-ui-test][status:in progress for fix]
This can be also reproduce on v1.4 aswell, build:

Gaia      ea4a1f0d94a995486ed219f47132949071ecc172                         
Gecko     https://hg.mozilla.org/mozilla-central/rev/262e73a6b7cd          
BuildID   20140206160203                                                   
Version   30.0a1
Summary: [v1.3][Cost Control] Resetting wi-fi usage from Cost Control app does not always reset to 0 B → [Cost Control] Resetting wi-fi usage from Cost Control app does not always reset to 0 B
Target Milestone: --- → 1.4 S1 (14feb)
Attached patch Patch (obsolete) — Splinter Review
Patch to update stats before reset.
Attachment #8373320 - Flags: review?(gene.lian)
Comment on attachment 8373320 [details] [diff] [review]
Patch

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

Wrong patch?
Attachment #8373320 - Flags: review?(gene.lian) → review-
Attached patch Patch (obsolete) — Splinter Review
Correct patch
Attachment #8373320 - Attachment is obsolete: true
Attachment #8373855 - Flags: review?(gene.lian)
Comment on attachment 8373855 [details] [diff] [review]
Patch

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

Looks good to me. Just some nits.

::: dom/network/src/NetworkStatsService.jsm
@@ +473,5 @@
> +          return;
> +        }
> +
> +        self._db.clearInterfaceStats(network, function onDBCleared(aError, aResult) {
> +            self._updateCurrentAlarm(aNetId);

Please indent the codes with just 2 spaces.

@@ +498,5 @@
>  
> +      self.updateAllStats(function onUpdate(aResult, aMessage){
> +        if (!aResult) {
> +          mm.sendAsyncMessage("NetworkStats:ClearAll:Return",
> +                            { id: msg.id, error: aMessage, result: null });

Please properly align this.
Attachment #8373855 - Flags: review?(gene.lian) → review+
Depends on: 966244
Attached patch PatchSplinter Review
Nits fixed
Attachment #8373855 - Attachment is obsolete: true
Attachment #8373967 - Flags: review+
Keywords: checkin-needed
Doesn't apply to b2g-inbound. Please rebase.
Keywords: checkin-needed
This patch should be applied after the patch of bug 966244, which is marked as a dependency.
Depends on: 965319
You probably want to reconsider this bug's blocking status as well if you're doing all the other ones.
blocking-b2g: 1.3+ → 1.3?
(In reply to Ryan VanderMeulen [:RyanVM UTC-5] from comment #16)
> You probably want to reconsider this bug's blocking status as well if you're
> doing all the other ones.

Actually this one is a legitimate user facing regression, so this one would block. The ones where we don't have regression proof is where we should renom.
blocking-b2g: 1.3? → 1.3+
(In reply to Jason Smith [:jsmith] from comment #17)
> (In reply to Ryan VanderMeulen [:RyanVM UTC-5] from comment #16)
> > You probably want to reconsider this bug's blocking status as well if you're
> > doing all the other ones.
> 
> Actually this one is a legitimate user facing regression, so this one would
> block. The ones where we don't have regression proof is where we should
> renom.

Although I do the dependencies you are linking to here, so the real problem here is that might be the wrong way to fix the bug.
Yeah, the point is that this bug as-patched depends on the other ones that were backed out and put up for reconsideration.
Attached patch Patch for 1.3Splinter Review
Rebase for 1.3

Removed dependencies from other bugs that had been backed out.
Attachment #8375421 - Flags: review?(gene.lian)
Request approval before uplifting.
Flags: needinfo?(fabrice)
https://hg.mozilla.org/mozilla-central/rev/2ed60f63b7a6
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
(In reply to Albert [:albert] from comment #22)
> Request approval before uplifting.

Please use the approval-mozilla-b2g28? flag on the patch.
Flags: needinfo?(fabrice) → needinfo?(acperez)
Comment on attachment 8375421 [details] [diff] [review]
Patch for 1.3

NOTE: This flag is now for security issues only. Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
User impact if declined: Costcontrol will report more usage than the real.
Testing completed: yes
Risk to taking this patch (and alternatives if risky): low
String or UUID changes made by this patch: none
Attachment #8375421 - Flags: approval-mozilla-b2g28?
Flags: needinfo?(acperez) → needinfo?(fabrice)
Attachment #8375421 - Flags: review?(gene.lian) → review+
Flags: needinfo?(fabrice)
Attachment #8375421 - Flags: approval-mozilla-b2g28? → approval-mozilla-b2g28+
https://hg.mozilla.org/releases/mozilla-b2g28_v1_3/rev/83d4288720dd
Whiteboard: [fromAutomation][gaia-ui-test][status:in progress for fix] → [fromAutomation][gaia-ui-test]
See Also: → 980817
See Also: 980817
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: