Compare commits

...
Author SHA1 Message Date
Sarah Fortune 3fc639d7b0 Revert "Fix the case if the app state and the user state are inconsistent (#5…"
This reverts commit 922cfed632.
2025-08-15 11:56:23 +01:00
+4 -7
View File
@@ -44,7 +44,6 @@ export class Controller {
mcpHub: McpHub
accountService: ClineAccountService
authService: AuthService
readonly cacheService: CacheService
constructor(
@@ -56,13 +55,13 @@ export class Controller {
HostProvider.get().logToChannel("ClineProvider instantiated")
this.accountService = ClineAccountService.getInstance()
this.cacheService = new CacheService(context)
this.authService = AuthService.getInstance(this)
const authService = AuthService.getInstance(this)
// Initialize cache service asynchronously - critical for extension functionality
this.cacheService
.initialize()
.then(() => {
this.authService.restoreRefreshTokenAndRetrieveAuthInfo()
authService.restoreRefreshTokenAndRetrieveAuthInfo()
})
.catch((error) => {
console.error("CRITICAL: Failed to initialize CacheService - extension may not function properly:", error)
@@ -309,7 +308,7 @@ export class Controller {
async handleAuthCallback(customToken: string, provider: string | null = null) {
try {
await this.authService.handleAuthCallback(customToken, provider ? provider : "google")
await AuthService.getInstance(this).handleAuthCallback(customToken, provider ? provider : "google")
const clineProvider: ApiProvider = "cline"
@@ -595,9 +594,7 @@ export class Controller {
const terminalReuseEnabled = this.cacheService.getGlobalStateKey("terminalReuseEnabled")
const defaultTerminalProfile = this.cacheService.getGlobalStateKey("defaultTerminalProfile")
const isNewUser = this.cacheService.getGlobalStateKey("isNewUser")
const welcomeViewCompleted = Boolean(
this.cacheService.getGlobalStateKey("welcomeViewCompleted") || this.authService.getInfo()?.user?.uid,
)
const welcomeViewCompleted = this.cacheService.getGlobalStateKey("welcomeViewCompleted")
const mcpResponsesCollapsed = this.cacheService.getGlobalStateKey("mcpResponsesCollapsed")
const terminalOutputLineLimit = this.cacheService.getGlobalStateKey("terminalOutputLineLimit")
const localClineRulesToggles = this.cacheService.getWorkspaceStateKey("localClineRulesToggles")