dropbox-sdk-obj-c icon indicating copy to clipboard operation
dropbox-sdk-obj-c copied to clipboard

Method checkAndPerformV1TokenMigration does not delete old V1 tokens on success

Open delitestudio opened this issue 7 years ago • 3 comments

Hi, we have used checkAndPerformV1TokenMigration method to upgrade old V1 tokens to the new format but we've seen that after an uninstall of the application the procedure starts over migrating old tokens, even if a unlinkAndResetClients has been called.

We think the checkAndPerformV1TokenMigration does not delete old tokens from keychain after successful migration. Is there a way to solve this problem? Thanks!

delitestudio avatar Jun 23 '17 12:06 delitestudio

Thanks @delitestudio ! For reference, the implementation of checkAndPerformV1TokenMigration can be found here.

It doesn't delete the original tokens, and unlinkAndResetClients would only apply to the new tokens. Also, the bit that indicates the migration already occurred is stored in NSUserDefaults, which is cleared on uninstall.

Is the concern that it may surprise users that they are automatically migrated again after uninstalling the app once, despite the call to unlinkAndResetClients? (Users can always unlink all access tokens for an app from their account security page though.) I'll send this along as a request to automatically delete the old tokens when checkAndPerformV1TokenMigration succeeds though.

As a workaround, you can delete the old tokens yourself if you'd like. You can see how they're retrieved from the keychain here and here.

greg-db avatar Jun 23 '17 21:06 greg-db

Hello @greg-db and thanks for your fast answer.

Is the concern that it may surprise users that they are automatically migrated again after uninstalling the app once, despite the call to unlinkAndResetClients?

We think it's not a big problem for users and we suppose that if they uninstall an application there's a little chance that they will re-install it. It just turned out in our debug sessions and we decided to alert you of this behaviour. We personally believe it will be cleaner to remove old tokens after a successful migration because there is little/no chance they will be reused.

delitestudio avatar Jun 26 '17 08:06 delitestudio

I see, thank you!

greg-db avatar Jun 26 '17 21:06 greg-db