edina / fieldtrip-osm

Fieldtrip OSM is a mobile mapping and data collection app that is available for iPhone and Android devices.
Other
1 stars 0 forks source link

pcapi Session not linked -- Creating new session #48

Closed gmh04 closed 9 years ago

gmh04 commented 9 years ago

When debugging a separate problem I noticed I was getting the following object returned using /1.3/pcapi/fs/dropbox/p8p3HrWspe02On5j/features/

{
    "msg": "Invalid Dropbox Session. Relogin",
    "error": 1
}

This suggests that the stored session is invalid. I noticed in the pcapi log:

2015-05-14 11:24:12,889 - pcapi.PCAPIRest:598 - DEBUG - URL: http://dlib-oxgangs.ucs.ed.ac.uk:8000/1.3/pcapi/auth/dropbox/p8p3HrWspe02On5j?_=1431599049380
2015-05-14 11:24:12,890 - pcapi.PCAPIRest:607 - DEBUG - provider: dropbox, async: False, oauth_token: None, userid: p8p3HrWspe02On5j, callback: False
2015-05-14 11:24:12,890 - pcapi.PCAPIRest:609 - DEBUG - host: dlib-rainbow.edina.ac.uk, port: 80
2015-05-14 11:24:12,890 - pcapi.PCAPIRest:640 - DEBUG - resuming session p8p3HrWspe02On5j
2015-05-14 11:24:12,890 - pcapi.DropboxProvider:155 - DEBUG - User has a token: p8p3HrWspe02On5j
2015-05-14 11:24:12,890 - pcapi.DropboxProvider:180 - DEBUG - Session not linked -- Creating new session
2015-05-14 11:24:13,816 - pcapi:116 - DEBUG - persistent-id None
2015-05-14 11:24:13,817 - pcapi:118 - DEBUG - persistent-id: None

I would have expected the app to get a new session key with "Creating new session". Yet the app continued to use the original key 'p8p3HrWspe02On5j':

05-14 11:05:45.200 D/CordovaLog(20648): file:///android_asset/www/plugins/overlays/js/ext/pcapi.js: Line 492 : Get items of features with http://dlib-oxgangs.ucs.ed.ac.uk:8000/1.3/pcapi/fs/dropbox/p8p3HrWspe02On5j/features/

Its not clear where the problem lies, with the pcapi or app. But it may be difficult to reproduce, unless we can invalidate tokens more quickly (than the current month).