pushd icon indicating copy to clipboard operation
pushd copied to clipboard

crash at second HTTP POST /subscribers

Open fredericfalliere opened this issue 11 years ago • 2 comments

Bonjour,

so I'm posting to /subscribers like so :+1:

 NSString* dToken = [[[deviceToken description]
                stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]]
               stringByReplacingOccurrencesOfString:@" "
               withString:@""];

AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSDictionary *parameters = @{@"proto": @"apns", @"token":dToken};
[manager POST:@"http://<myserveurplease>/subscribers" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {

    NSString* id = [responseObject valueForKey:@"id"];


} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"Error: %@", error);
}];
  • The first time I got a deviceId.
  • without changing one line of code, I rerun the app
  • crash (the server)

Here's the log output :

/pushd_server/node_modules/redis/index.js:563 throw callback_err; ^ TypeError: Cannot read property '0' of undefined at /pushd_server/lib/subscriber.coffee:147:20 at Command.callback (/pushd_server/node_modules/redis/index.js:1105:17) at RedisClient.return_error (/pushd_server/node_modules/redis/index.js:559:25) at HiredisReplyParser. (/pushd_server/node_modules/redis/index.js:306:18) at HiredisReplyParser.EventEmitter.emit (events.js:95:17) at HiredisReplyParser.execute (/pushd_server/node_modules/redis/lib/parser/hiredis.js:41:18) at RedisClient.on_data (/pushd_server/node_modules/redis/index.js:535:27) at Socket. (/pushd_server/node_modules/redis/index.js:91:14) at Socket.EventEmitter.emit (events.js:95:17) at Socket. (stream_readable.js:746:14) at Socket.EventEmitter.emit (events.js:92:17) at emitReadable (_stream_readable.js:408:10) at emitReadable (_stream_readable.js:404:5) at readableAddChunk (_stream_readable.js:165:9) at Socket.Readable.push (_stream_readable.js:127:10) at TCP.onread (net.js:526:21)

fredericfalliere avatar Mar 01 '14 10:03 fredericfalliere

j'ai créé une pull request : https://github.com/rs/pushd/pull/63

... in the hope this will help someone

fredericfalliere avatar Mar 01 '14 10:03 fredericfalliere

hmmm ok I think there's an issue with my redis install.

I'm getting this kind of error when subscribing to an event.

Damn my saturday morning :(

fredericfalliere avatar Mar 01 '14 11:03 fredericfalliere