schedjoules / android-event-discovery-sdk

0 stars 1 forks source link

Link parsing crash #301

Closed lemonboston closed 7 years ago

lemonboston commented 7 years ago

Just got this (master branch) when scrolling down the list for Dresden:

6-08 16:42:02.213 E/AndroidRuntime: FATAL EXCEPTION: main
                                     Process: com.schedjoules.eventdiscovery.demo, PID: 8456
                                     java.lang.IllegalArgumentException: Scheme-specific part expected at index 5: http:
                                         at java.net.URI.create(URI.java:733)
                                         at com.schedjoules.client.eventsdiscovery.json.JsonLink.target(JsonLink.java:69)
                                         at com.schedjoules.eventdiscovery.framework.utils.SchedJoulesLinks.uriForRel(SchedJoulesLinks.java:64)
                                         at com.schedjoules.eventdiscovery.framework.utils.SchedJoulesLinks.thumbnailUri(SchedJoulesLinks.java:48)
                                         at com.schedjoules.eventdiscovery.framework.eventlist.items.EventItem.bindDataTo(EventItem.java:75)
                                         at com.schedjoules.eventdiscovery.framework.eventlist.items.EventItem.bindDataTo(EventItem.java:43)
                                         at com.schedjoules.eventdiscovery.framework.list.flexibleadapter.FlexibleSectionableAdapter.bindViewHolder(FlexibleSectionableAdapter.java:63)
                                         at com.schedjoules.eventdiscovery.framework.list.flexibleadapter.FlexibleSectionableAdapter.bindViewHolder(FlexibleSectionableAdapter.java:39)
                                         at eu.davidea.flexibleadapter.FlexibleAdapter.onBindViewHolder(FlexibleAdapter.java:1867)
                                         at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6100)
                                         at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5282)
                                         at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5158)
                                         at android.support.v7.widget.RecyclerView$Recycler.prefetch(RecyclerView.java:5937)
                                         at android.support.v7.widget.RecyclerView$ViewPrefetcher.run(RecyclerView.java:4529)
                                         at android.os.Handler.handleCallback(Handler.java:739)
                                         at android.os.Handler.dispatchMessage(Handler.java:95)
                                         at android.os.Looper.loop(Looper.java:148)
                                         at android.app.ActivityThread.main(ActivityThread.java:5417)
                                         at java.lang.reflect.Method.invoke(Native Method)
                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
lemonboston commented 7 years ago

I've debugged it and the json contains an incorrect href as only 'http' for the thumbnail and banner:

{
   "uid":"92fb316256d9363a",
   "created":"2017-06-08T13:50:18",
   "updated":"2017-06-08T13:50:20",
   "title":"FEATURE RING",
   "description":null,
   "locations":{
      "start":{
         "name":"Festspielhaus Hellerau - Dalcrozesaal",
         "coordinates":"geo:51.1137575,13.7531038",
         "address":{
            "street":"Karl-Liebknecht-Straße 56",
            "region":null,
            "postcode":null,
            "locality":"Dresden",
            "country":"Germany"
         }
      }
   },
   "isAllDay":false,
   "start":"2017-06-12T19:00:00",
   "timeZone":"UTC",
   "duration":"PT2H",
   "links":[
      {
         "rel":"http:\/\/schedjoules.com\/rel\/banner",
         "type":"image\/png",
         "href":"http:",
         "properties":{
            "https:\/\/schedjoules.com\/prop\/width":"768",
            "https:\/\/schedjoules.com\/prop\/height":"512"
         }
      },
      {
         "rel":"http:\/\/schedjoules.com\/rel\/thumbnail",
         "type":"image\/png",
         "href":"http:",
         "properties":{
            "https:\/\/schedjoules.com\/prop\/width":"128",
            "https:\/\/schedjoules.com\/prop\/height":"128"
         }
      }
   ]
}

@rutgerg Could you please have a look?

The discovery requests from the log if needed (scrolling down for Dresden, crashes at about 12 June):

06-08 16:47:15.619 D/EventDiscovery-Request: GET https://api.schedjoules.com/events?latlng=51.050407,13.737262&start_at_or_after=2017-06-08T14:47:15Z&radius=10000&u=97495a44-b47e-4c64-a45b-a2e1475bc50b
06-08 16:47:16.659 D/EventDiscovery-Request: GET https://api.schedjoules.com/events?latlng=51.050407,13.737262&locale=en&preceding=f91c8b9c4236cf02&radius=10000&u=97495a44-b47e-4c64-a45b-a2e1475bc50b
lemonboston commented 7 years ago

Issue moved to schedjoules/event-discovery-backend #96 via ZenHub