nagyistoce / growl

Automatically exported from code.google.com/p/growl
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

problems with clickContext in new Growl (duplicate calls and incorrect types) #377

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a simple app with latest Growl framework, one notification type 
"Commit received" in the growlRegDict and such code in the application delegate:

- (void) applicationDidFinishLaunching: (NSNotification *) aNotification {
  NSNumber *objectId = [NSNumber numberWithInt: 5];
  [GrowlApplicationBridge setGrowlDelegate: (NSObject<GrowlApplicationBridgeDelegate>*) self];
  [GrowlApplicationBridge notifyWithTitle: @"Growl Test 1"
                              description: @"With context"
                         notificationName: @"Commit received"
                                 iconData: nil
                                 priority: 0
                                 isSticky: NO
                             clickContext: objectId];
  [GrowlApplicationBridge notifyWithTitle: @"Growl Test 2"
                              description: @"Without context"
                         notificationName: @"Commit received"
                                 iconData: nil
                                 priority: 0
                                 isSticky: NO
                             clickContext: nil];
}

- (void) growlNotificationWasClicked: (id) clickContext {
  NSLog(@"context = %@ (%@)", clickContext, NSStringFromClass([clickContext class]));
}

2. Start the app.
3. Click the "Growl Test 1" notification immediately after it appears.
4. Restart the app.
5. Click the "Growl Test 1" notification about 3 seconds after it appears.

What is the expected output?

2 - the notifications should appear in order as in the code: "Growl Test 1" 
then "Growl Test 2".

3 - it should print "context = 5 (__NSCFNumber)" in the console

5 - it should print "context = 5 (__NSCFNumber)" in the console

What do you see instead?

2 - about 50% of the time, the notifications appear in opposite order - "Growl 
Test 2" then "Growl Test 1".

3 - it prints two lines in the console: "context = 5 (__NSCFNumber)" and 
"context = 5 (__NSCFConstantString)". The callback gets called two times 
instead of one, and the second time the context is returned as a string.

5 - it prints "context = 5 (__NSCFNumber)" in the console, but before that it 
prints an error: "Got disconnected: Error Domain=GCDAsyncSocketErrorDomain 
Code=4 "Read operation timed out" UserInfo=0x10044d840 
{NSLocalizedDescription=Read operation timed out}"

Note: if you change the first call to pass "clickContext: nil", then the 
notifications always appear in the right order (1 then 2).

Sample application attached below.

Original issue reported on code.google.com by jakub.su...@gmail.com on 21 Nov 2011 at 7:10

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by ch...@growl.info on 22 May 2012 at 12:32

GoogleCodeExporter commented 9 years ago

Original comment by ch...@growl.info on 27 Aug 2012 at 1:38

GoogleCodeExporter commented 9 years ago
We believe this is resolved in Growl 2. Can you validate that?

Original comment by ch...@growl.info on 5 Oct 2012 at 4:50

GoogleCodeExporter commented 9 years ago
Growl 2.1/Growl.framework should ultimately resolve this with the redesign.  
Closing as fixed in source

Original comment by dan...@growl.info on 18 Jun 2013 at 10:12