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

use the accurate docContext and persist repo visibility using local storage #5767

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hitesh-1997
Copy link
Contributor

@hitesh-1997 hitesh-1997 commented Oct 1, 2024

The PR improves the following:

  1. When calculating the diff over time for suggestion, we were using document.getText. Analyzing offline telemetry we see in ~20% we get some extra chars if user types between calculating docContext and loaded call. We leverage already computed completePrefix and completeSuffix to compute the text, which is accurate.
  2. We were using in-memory cache for calculating repoVisibility before. But without passing token, we frequently hit rate limit for querying github api and cached tokens are evicted from in-memory cache when user refresh. This PR stores the tokens in localStorage instead of in-memory store to cache the repo visibility.

Test plan

Manual Testing

  1. Adding debugger and refreshing to see if the token value is persisted/ deleted from local storage.

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.

1 participant