Closed Bug 1231518 Opened 4 years ago Closed 4 years ago

Sound is played back every time New Tab Page opened, if you once have deleted a ProfLD folder

Categories

(Firefox :: New Tab Page, defect)

44 Branch
Unspecified
Windows 7
defect
Not set

Tracking

()

VERIFIED FIXED
Firefox 46
Tracking Status
firefox42 --- unaffected
firefox43 --- unaffected
firefox44 + wontfix
firefox45 - verified
firefox46 --- verified
firefox-esr38 --- unaffected

People

(Reporter: alice0775, Assigned: mchang)

References

Details

(Keywords: regression)

Attachments

(1 file)

Reproducible: always

Steps to reproduce:
1. Start Firefox with New Profile
2. Open New Tab Page and Delete all tiles by click [x]
3. Open http://peach.themazzone.com/durian/movies/sintel-1280-surround.mp4 in the Tab
4. Close Firefox when the video starts
5. Delete ProfLD folder
   (i.e., C:\Users\userName\AppData\Local\Mozilla\Firefox\Profiles\xxxx.profileName)
6. Restart Firefox with the Profile
7. Open New Tab and wait for a while
[Tracking Requested - why for this release]:
Regression window:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=89c9c63c76543e3900e06640cc6e365edfeb4881&tochange=f6b31718d94d59bb3eb3c27386fea90701a6772a

Regressed by: f6b31718d94d	Mason Chang — Bug 1215659. Use destination canvas for thumbnail size if provided one. r=adw
Blocks: 1215659
Flags: needinfo?(mchang)
Keywords: regression
Summary: sound playbacks unexpectedly when open New Tab Page after delete ProfLD folder → Sound is played back every time New Tab Page opened, if you once have deleted a ProfLD folder
Actually if I use a nightly, I get an error which says "Your nightly profile cannot be loaded. It may be missing or inaccessible", which seems to be the proper solution to this bug. 

@adw - Do you know when this profile check was added or who would be the right person to contact? Thanks!
Flags: needinfo?(mchang) → needinfo?(adw)
For releng, I do not think we need to track this to a release. This regression occurs from a user actively deleting a firefox profile through non-standard ways and technically causing a regression. However, I do not think we should support any weird problems that occur from a user actively deleting files from their computer outside of firefox supported UI interactions.
Why did the patch cause this though?  (Can it be reproduced without it?)  newtab should never trigger sounds in pages that it shows.  We wrote code to specifically prevent that from happening.  I don't know about that profile check thing, but if newtab is triggering sound at all, it might point to a bigger problem that could happen in other cases.
Flags: needinfo?(adw)
(In reply to Drew Willcoxon :adw from comment #5)
> Why did the patch cause this though?  (Can it be reproduced without it?) 
> newtab should never trigger sounds in pages that it shows.  We wrote code to
> specifically prevent that from happening.  I don't know about that profile
> check thing, but if newtab is triggering sound at all, it might point to a
> bigger problem that could happen in other cases.

Without deleting the profile folder from the hard drive, newtab does not generate sound. I can't reproduce this without manually deleting the profile folder, and I can't test if this reproduces without the patch since nightly won't start a profile that has had the profile folder deleted.
It looks like something happens between a local build versus a released build where Firefox will try to start up with a profile, even if the profile folder was deleted. We actually recreate the profile directory with the same directory name on official release builds (including nightly / dev edition), while with a local build, we popup with a dialog that says "could not find your profile". 

@dao - Can you please take a look at this? Is the popup dialog supposed to show up?
Flags: needinfo?(dao)
Summary: Sound is played back every time New Tab Page opened, if you once have deleted a ProfLD folder → Dialog stating a profile could not be found never comes up
To be clear, I never delete ProfD, just delete ProfLD in STR of comment#0.

ProfLD = Local Setting folder (see https://developer.mozilla.org/en-US/Add-ons/Code_snippets/File_I_O#Getting_files_in_special_directories)
@Mason Chang, 
If you delete ProfD, you are misunderstand STR.
You should not detele ProfD, just delete ProfLD. see STR.
Summary: Dialog stating a profile could not be found never comes up → Sound is played back every time New Tab Page opened, if you once have deleted a ProfLD folder
(In reply to Mason Chang [:mchang] from comment #7)
> It looks like something happens between a local build versus a released
> build where Firefox will try to start up with a profile, even if the profile
> folder was deleted. We actually recreate the profile directory with the same
> directory name on official release builds (including nightly / dev edition),
> while with a local build, we popup with a dialog that says "could not find
> your profile". 
> 
> @dao - Can you please take a look at this? Is the popup dialog supposed to
> show up?

Redirecting to Benjamin who I think owns this stuff (I could be wrong though).
Flags: needinfo?(dao) → needinfo?(benjamin)
(In reply to Alice0775 White from comment #8)
> To be clear, I never delete ProfD, just delete ProfLD in STR of comment#0.
> 
> ProfLD = Local Setting folder (see
> https://developer.mozilla.org/en-US/Add-ons/Code_snippets/
> File_I_O#Getting_files_in_special_directories)

Yeah, thanks for that clarification. I deleted the directory as listed from comment 0.
Tracked in FF44 for now since it's still early in the Beta cycle but I would not block it on this issue as the scenario to get it to repro do not sound all that commonly occurring.
Does the new-tab page really have anything to do with this? I'd expect this to be a general problem of not being able to do various kinds of media playback if ProfLD is missing.

If I'm reading the code correctly, we are supposed to fail startup if the directory doesn't exist, here: http://hg.mozilla.org/mozilla-central/annotate/ad16863d1d45/toolkit/xre/nsXREDirProvider.cpp#l141. The next step for this would be for somebody to debug through that code and see what it does.

I do not see any reason for this to be tracked.
Flags: needinfo?(benjamin)
Given that we don't have a fix yet and this is really not a common scenario, marking this as wontfix for FF44.
This is more common bug than described in comment 0 OFC.

STR:
1. Start Firefox with New Profile
2. Open New Tab Page, open New Tab Page
3. Click gear button, click "Show blank page"
4. Restart Firefox
5. Open http://peach.themazzone.com/durian/movies/sintel-1280-surround.mp4 in a new tab
6. Close that when the video starts
7. Open New Tab Page, click gear button, click "Show your top sites" and wait for a while
Tested on e10s and non-e10s with the STR from comment 15.

It looks like the part to check that the component request returned success is causing the playback to occur. [1]

[1] https://dxr.mozilla.org/mozilla-central/source/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js#102
Assignee: nobody → mchang
I originally added the Components.isSuccess() code there from here - https://bugzilla.mozilla.org/show_bug.cgi?id=1215659#c3. This caused a black newtab image but I could only reproduce this on an iMac. I went back to Firefox 43, which is before both bug 1215659 and 1197361, so it must be a long standing bug before this.
See Also: → 1183044
Verified fixes the sound issue on Windows and loads about:blank instead of a black box on OS X and an iMac.
Attachment #8703845 - Flags: review?(adw)
Comment on attachment 8703845 [details] [diff] [review]
Load about:blank if thumbnail loader fails

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

Thanks Mason.  Sorry I didn't catch this in review last time.
Attachment #8703845 - Flags: review?(adw) → review+
https://hg.mozilla.org/mozilla-central/rev/fd998a174ee5
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 46
>>>   My Info:   Win7_64, Nightly 46, 32bit, ID 20160105030211
I tested 2 urls (url from comment 0 and "http://lotto.pch.com/" from bug 1183044 comment 0)
with 2 scenarios to trigger New Tab Page to take a screenshot of the page:
(1) to delete the thumbnail from cache directory, as said in comment 0
(2) to enable tiles on New Tab Page only after saving the page in History, as said in comment 15

I don't see this issue anymore.
However, New Tab now shows blank thumbnail for the video from Comment 0. Is that expected result?
(In reply to arni2033 from comment #22)
> >>>   My Info:   Win7_64, Nightly 46, 32bit, ID 20160105030211
> I tested 2 urls (url from comment 0 and "http://lotto.pch.com/" from bug
> 1183044 comment 0)
> with 2 scenarios to trigger New Tab Page to take a screenshot of the page:
> (1) to delete the thumbnail from cache directory, as said in comment 0
> (2) to enable tiles on New Tab Page only after saving the page in History,
> as said in comment 15
> 
> I don't see this issue anymore.
> However, New Tab now shows blank thumbnail for the video from Comment 0. Is
> that expected result?

I think this is the expected result. If we fail to load a webpage, we load a blank white page instead. Also, I'm not exactly sure what the thumbnail should be for a video. Previously, it would be a gray background with a black box but still not show any frames of the actual video.
Comment on attachment 8703845 [details] [diff] [review]
Load about:blank if thumbnail loader fails

Approval Request Comment
[Feature/regressing bug #]: Bug 1215659
[User impact if declined]: User can hear audio when newtab page loads
[Describe test coverage new/current, TreeHerder]: Manual testing
[Risks and why]: Low, this fixes an issue where we would capture a thumbnail for a newtab and not properly set the default state to about:blank if the capture failed.
[String/UUID change made/needed]: None
Attachment #8703845 - Flags: approval-mozilla-aurora?
Comment on attachment 8703845 [details] [diff] [review]
Load about:blank if thumbnail loader fails

Why not.
Attachment #8703845 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Flags: qe-verify+
I managed to reproduce this issue on Firefox 44 RC and on Windows 10 x86, using the STR from Comment 15.
This issue was verified on Firefox 45.0b1, Firefox 46.0a2 (2016-01-31) and Firefox 47.0a1 (2016-01-31) across platforms[1] and is no longer reproducible.
[1] Windows 10 x86, Ubuntu 14.04 x86 and Mac OS X 10.11
Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.