genie-toolkit
genie-toolkit copied to clipboard
New refresh tokens are not stored correctly when using cloud sync
Not sure where the bug really is, so filing it here and then we'll find the right place.
Currently, tests for thingpedia-common-devices in Travis fail intermittently in Spotify, because API calls fail with "Refresh token revoked". A bit of investigation reveals that PKCE-enabled refresh tokens are single use only, and we need to store the new token when we get one. Something, somewhere, is failing to store the new token.
@jmhw0123 think this might have something to do with the failure you were seeing on Travis?
@jmhw0123 think this might have something to do with the failure you were seeing on Travis?
Yeah. I think it's probably one of the reasons.
Ok I bumped it up to P1, Spotify skill is one of our focuses and we're writing and running automated tests -- random failures undermine that.
@gcampax any idea what it may take to address this?
We need to investigate exactly where the sync goes wrong (could be in the cloud, could be in the client), and then fix that. The main issue is that the sync connection might drop before the client had a chance to upload the new refresh token to the cloud, in which case we never store the new refresh token. Next time we run the tests, we fetch the invalidated refresh token again and die. We might be able to force the scenario tests to sync with the cloud before it closes.
The other issue is that both unit tests and scenario tests run concurrently. If both refresh at the same time we'll get in trouble.