stringer-rss / stringer

A self-hosted, anti-social RSS reader.
MIT License
3.94k stars 396 forks source link

Reeder client crashing #156

Closed stefanoverna closed 11 years ago

stefanoverna commented 11 years ago

Alright, so I have a stringer instance with just one feed.

I configure Reeder, it starts synching for the first time. I sniffed the traffic between the app and stringer, the following requests are being performed:

# Authentication
POST {"api"=>nil, "api_key"=>"a7ea34b6845a789d10d3f50610d9a6be"}
{"api_version":3,"auth":1,"last_refreshed_on_time":1369482145}

# Unread items
 POST {"api"=>nil, "unread_item_ids"=>nil, "api_key"=>"a7ea34b6845a789d10d3f50610d9a6be"}
 {"api_version":3,"auth":1,"last_refreshed_on_time":1369483660,"unread_item_ids":[]}

# Groups
 POST {"api"=>nil, "groups"=>nil, "api_key"=>"a7ea34b6845a789d10d3f50610d9a6be"}
 {"api_version":3,"auth":1,"last_refreshed_on_time":1369483660,"groups":[{"id":1,"title":"All items"}],"feeds_groups":[{"group_id":1,"feed_ids":"1"}]}

# Feeds
 POST {"api"=>nil, "feeds"=>nil, "api_key"=>"a7ea34b6845a789d10d3f50610d9a6be"}
 {"api_version":3,"auth":1,"last_refreshed_on_time":1369483660,"feeds":[{"id":1,"favicon_id":0,"title":"Stefano Verna - Articoli ","url":"http://feeds.stefanoverna.com/stefanoverna","site_url":"http://feeds.stefanoverna.com/stefanoverna","is_spark":0,"last_updated_on_time":1369483122}],"feeds_groups":[{"group_id":1,"feed_ids":"1"}]}

All seems just fine, but the app crashes. Opening the device console in XCode, the following error appears:

May 25 14:07:37 iPhone Reeder[525] <Error>: -[__NSArrayI isEqualToString:]: unrecognized selector sent to instance 0x1cd24830

So I guess that parsing one of the above responses, Reeder expects a string for some field, but instead it finds a JSON array. It tries to compare the array with the string, and the app crashes.

The only thing that comes into my mind is the following sentence in the Fever API docs:

Feeds

http://yourdomain.com/fever/?api&feeds

A request with the feeds argument will return two additional members:

  • feeds contains an array of group objects
  • feeds_groups contains an array of feeds_group objects

You see it? :) "feeds contains an array of group objects". Our feeds field countains array of feed objects, not group objects. I think this is a doc typo, but you never know :)

To further investigate the issue I would need a Fever installation, which I don't have.

Swatto commented 11 years ago

Same crashing for me

swanson commented 11 years ago

http://www.twitlonger.com/show/ltnbic

Looks like this might be the problem.

stefanoverna commented 11 years ago

Great! I'll try a patch asap

stefanoverna commented 11 years ago

See #158 for working solution