{"action":"created","issue":{"url":"https://api.github.com/repos/sedouard/connected-car-api/issues/26","labels_url":"https://api.github.com/repos/sedouard/connected-car-api/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/sedouard/connected-car-api/issues/26/comments","events_url":"https://api.github.com/repos/sedouard/connected-car-api/issues/26/events","html_url":"https://github.com/sedouard/connected-car-api/issues/26","id":89404823,"number":26,"title":"API has trouble serving trips","user":{"login":"felixrieseberg","id":1426799,"avatar_url":"https://avatars.githubusercontent.com/u/1426799?v=3","gravatar_id":"","url":"https://api.github.com/users/felixrieseberg","html_url":"https://github.com/felixrieseberg","followers_url":"https://api.github.com/users/felixrieseberg/followers","following_url":"https://api.github.com/users/felixrieseberg/following{/other_user}","gists_url":"https://api.github.com/users/felixrieseberg/gists{/gist_id}","starred_url":"https://api.github.com/users/felixrieseberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixrieseberg/subscriptions","organizations_url":"https://api.github.com/users/felixrieseberg/orgs","repos_url":"https://api.github.com/users/felixrieseberg/repos","events_url":"https://api.github.com/users/felixrieseberg/events{/privacy}","received_events_url":"https://api.github.com/users/felixrieseberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-18T21:40:46Z","updated_at":"2015-06-20T14:20:57Z","closed_at":null,"body":"(Don't deal with this before you're back from vacation)\r\n\r\n@irjudson fixed Storm and apparently reached a point where he's able to write actual trips to table storage. Since a few things changed around, it seems like the API is now longer able to get those trips, resulting in various `undefined` properties and other errors. I believe that the culprit is in https://github.com/sedouard/connected-car-api/blob/master/lib/table-utils.js#L75-L140, but I'm not sure.\r\n\r\n### What's happening\r\nhttp://connected-car-api.azurewebsites.net/vehicles/55554370439c5a010068293b serves the right data, but http://connected-car-api.azurewebsites.net/vehicles/55554370439c5a010068293b/trips serves this:\r\n\r\n```JSON\r\n{\r\n    \"data\": [{\r\n        \"trip_events\": [],\r\n        \"links\": {\r\n            \"self\": \"http://connected-car-api.azurewebsites.net:80/trips/undefined\",\r\n            \"driver\": {\r\n                \"related\": \"http://connected-car-api.azurewebsites.net:80/drivers/undefined\"\r\n            }\r\n        }\r\n    }, {\r\n        \"trip_events\": [],\r\n        \"links\": {\r\n            \"self\": \"http://connected-car-api.azurewebsites.net:80/trips/undefined\",\r\n            \"driver\": {\r\n                \"related\": \"http://connected-car-api.azurewebsites.net:80/drivers/undefined\"\r\n            }\r\n        }\r\n    }]\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/sedouard/connected-car-api/issues/comments/113773734","html_url":"https://github.com/sedouard/connected-car-api/issues/26#issuecomment-113773734","issue_url":"https://api.github.com/repos/sedouard/connected-car-api/issues/26","id":113773734,"user":{"login":"sedouard","id":3053263,"avatar_url":"https://avatars.githubusercontent.com/u/3053263?v=3","gravatar_id":"","url":"https://api.github.com/users/sedouard","html_url":"https://github.com/sedouard","followers_url":"https://api.github.com/users/sedouard/followers","following_url":"https://api.github.com/users/sedouard/following{/other_user}","gists_url":"https://api.github.com/users/sedouard/gists{/gist_id}","starred_url":"https://api.github.com/users/sedouard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sedouard/subscriptions","organizations_url":"https://api.github.com/users/sedouard/orgs","repos_url":"https://api.github.com/users/sedouard/repos","events_url":"https://api.github.com/users/sedouard/events{/privacy}","received_events_url":"https://api.github.com/users/sedouard/received_events","type":"User","site_admin":false},"created_at":"2015-06-20T14:20:57Z","updated_at":"2015-06-20T14:20:57Z","body":"@irjudson - couple issues. first the data originally for `testcar6` and `testcar8` had partition keys in the form of:\r\n`DEVICE_ID.TRIP_SUMMARY_ROW_KEY`. This is no longer the case therefore in the troubled [area of code](https://github.com/sedouard/connected-car-api/blob/master/lib/table-utils.js#L24-L26) the query is returned wrong.\r\n\r\nSecond, when you change the name of a table that is used by the api, you must update the `trip_locations_table_name` on the azure website, otherwise the trip locations obviously cannot be queries. Before it was `tripLocations` according to the latest data it is `cleanLocations`.\r\n\r\nIf you can confirm what the table name and the partition key for trip location entries we'll be all set and I can make the fix (which is really easy). This this is really a breaking change in the underlying data source -- please give  a heads up next time.\r\n\r\nI'll make the fix on tuesday."}}