Last Comment Bug 749739 - New email sound notification file cannot contain spaces (Linux - Thunderbird 12)
: New email sound notification file cannot contain spaces (Linux - Thunderbird 12)
Product: Core
Classification: Components
Component: Widget: Gtk (show other bugs)
: Trunk
: x86 Linux
: -- normal (vote)
: mozilla15
Assigned To: Wolfgang Rosenauer [:wolfiR]
Depends on:
Blocks: 635918
  Show dependency treegraph
Reported: 2012-04-27 11:59 PDT by Pascalis Ligdas
Modified: 2012-05-10 00:36 PDT (History)
6 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (1.09 KB, patch)
2012-05-08 15:13 PDT, Wolfgang Rosenauer [:wolfiR]
karlt: review-
Details | Diff | Splinter Review
patch #2 (1.27 KB, patch)
2012-05-08 23:24 PDT, Wolfgang Rosenauer [:wolfiR]
karlt: review+
lukasblakk+bugs: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Pascalis Ligdas 2012-04-27 11:59:48 PDT
User Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20100101 Firefox/11.0
Build ID: 20120313130328

Steps to reproduce:

After update from v. 11 to 12.0 I cannot hear sound notification (.wav) If their filenames contain spaces. The "problem" is fixed if I rename the sound filo it doesn't contain spaces (My Sound.wav -> MySound.wav). I am using the Mailbox Alert 0.16.1 addon.
Comment 1 Hashem Masoud 2012-04-29 00:39:18 PDT
(In reply to Pascalis Ligdas from comment #0)
You have to report this to the add-on developer, this is not a bug in Thunderbird.
Comment 2 Pascalis Ligdas 2012-04-29 01:02:03 PDT
Reproduce in Thunderbird:

Edit > Preferences > General then check "Play a sound" and "Use the following sound file" and enter any wav file with spaces.

Note 1: Sound files with spaces play just fine in v.11
Note 2: This does not depend on the addon as I thought originally.
Comment 3 Hashem Masoud 2012-04-30 01:41:04 PDT
(In reply to Pascalis Ligdas from comment #2)
Confirmed here. Just after the upgrade, sounds don't play upon receiving messages. This is shown in the Error console when playing sounds from preferences:

Error: uncaught exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) []"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: chrome://messenger/content/preferences/general.js :: <TOP_LEVEL> :: line 94"  data: no]

User Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120420 Thunderbird/12.0
Application Build ID: 20120420153403
Comment 4 Hashem Masoud 2012-05-02 02:14:54 PDT
(In reply to Pascalis Ligdas from comment #2)
Bug 635918 was filed to fix inability to play sounds. Recent Thunderbird update contains fix for it. Previously I used the SoundPlus add-on but when upgrade to V.12 happened, the add-on did not work (the add-on needs to be updated).
Comment 5 Wolfgang Rosenauer [:wolfiR] 2012-05-02 02:44:58 PDT
I can confirm that issue that a wav file with whitespace is not played.
I do not see the error in the error console though.

I do not know if that is a regression caused by the changes in nsSound though as the reporter used an addon before apparently.
As nsSound is core I'll move the report.
Comment 6 Wolfgang Rosenauer [:wolfiR] 2012-05-02 03:54:05 PDT
Chris, I guess canberra does not like %20 as a whitespace?
Comment 7 Karl Tomlinson (back Dec 13 :karlt) 2012-05-02 16:33:51 PDT
Sounds like QueryInterface to nsIFileURL or perhaps g_filename_from_uri would be useful.
Comment 8 Wolfgang Rosenauer [:wolfiR] 2012-05-08 15:09:17 PDT
looking into it
Comment 9 Wolfgang Rosenauer [:wolfiR] 2012-05-08 15:13:26 PDT
Created attachment 622167 [details] [diff] [review]

use g_filename_from_uri() to get full path from spec
Comment 10 Karl Tomlinson (back Dec 13 :karlt) 2012-05-08 16:34:19 PDT
Comment on attachment 622167 [details] [diff] [review]

g_filename_from_uri returns a newly allocated string that needs to be freed.
It can return NULL on error so I think that should be checked.
Can you rename path to spec, please?
Comment 11 Wolfgang Rosenauer [:wolfiR] 2012-05-08 23:24:29 PDT
Created attachment 622292 [details] [diff] [review]
patch #2

null check and free path

I wasn't sure about the error ID (NS_ERROR_FILE_UNRECOGNIZED_PATH). Probably that choice doesn't match exactly. Should I just use a generic (NS_ERROR_FAILURE)?
Comment 12 Karl Tomlinson (back Dec 13 :karlt) 2012-05-08 23:51:00 PDT
Comment on attachment 622292 [details] [diff] [review]
patch #2

> I wasn't sure about the error ID (NS_ERROR_FILE_UNRECOGNIZED_PATH).

These error codes don't seem well defined, so I think this is fine as is.
Comment 13 Wolfgang Rosenauer [:wolfiR] 2012-05-09 04:31:02 PDT
Comment 14 Ludovic Hirlimann [:Usul] 2012-05-09 05:43:23 PDT
Comment on attachment 622292 [details] [diff] [review]
patch #2

[Approval Request Comment]
Regression caused by (bug #): 
User impact if declined: Won't ear notifications
Testing completed (on m-c, etc.): yes
Risk to taking this patch (and alternatives if risky):None
String changes made by this patch: None
Comment 15 Ed Morley [:emorley] 2012-05-09 07:45:24 PDT
Comment 16 Wolfgang Rosenauer [:wolfiR] 2012-05-10 00:36:55 PDT

Note You need to log in before you can comment on or make changes to this bug.