Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev: register command to clear Cody storages #4398

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented May 31, 2024

Add a new command to make it easier for Devs (currently in dev and test mode only) to clear current auth states and storages for debugging purpose.

  • Add a new command "cody.dev.clear" to remove the current access token, remove all stored access tokens, clear the local storage, and restart VS Code
  • Change the local storage key used to suppress Cody Pro expiration notifications
  • Refactor the local storage provider to use a centralized key map
  • Add a clear method to the local storage provider to easily clear all stored data except the anonymous user ID
  • Update the LocalStorageProvider to add a new key for the access token secret
  • Update the SecretStorageProvider to use the new access token secret key from the LocalStorageProvider
  • Remove the code to clear the storage and access token in the post-uninstall script, as this is now handled by the new "cody.dev.clear" command

Currently available in Dev & Test mode only.

Test plan

  1. Start Cody from this branch to make sure Chat history and Auth are still working as expected.
  2. Run the new command Cody Dev: Clear Cody Storage & Restart to verify you have been logged out
  3. Verify chat history and endpoint history are cleared after logging back in

- Change the local storage key used to suppress Cody Pro expiration notifications
- Refactor the local storage provider to use a centralized key map
- Add a clear method to the local storage provider to easily clear all stored data except the anonymous user ID
@abeatrix abeatrix changed the title Dev: Command to clear local and secret storage Dev: register command to clear Cody storages May 31, 2024
@abeatrix abeatrix marked this pull request as ready for review May 31, 2024 01:10
@abeatrix abeatrix requested review from jamesmcnamara and a team May 31, 2024 01:11
vscode/src/main.ts Outdated Show resolved Hide resolved
@abeatrix abeatrix marked this pull request as draft May 31, 2024 01:55
@abeatrix abeatrix marked this pull request as ready for review June 21, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants