mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Cloud: fix provider syncing (#7603)
ClineProvider creation was moved before CloudService which broke the old way of doing things.
This commit is contained in:
parent
0eb97d0e21
commit
a0e13fe388
2 changed files with 35 additions and 3 deletions
|
|
@ -213,9 +213,13 @@ export class ClineProvider
|
|||
}
|
||||
|
||||
// Initialize Roo Code Cloud profile sync.
|
||||
this.initializeCloudProfileSync().catch((error) => {
|
||||
this.log(`Failed to initialize cloud profile sync: ${error}`)
|
||||
})
|
||||
if (CloudService.hasInstance()) {
|
||||
this.initializeCloudProfileSync().catch((error) => {
|
||||
this.log(`Failed to initialize cloud profile sync: ${error}`)
|
||||
})
|
||||
} else {
|
||||
this.log("CloudService not ready, deferring cloud profile sync")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -305,6 +309,25 @@ export class ClineProvider
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize cloud profile synchronization when CloudService is ready
|
||||
* This method is called externally after CloudService has been initialized
|
||||
*/
|
||||
public async initializeCloudProfileSyncWhenReady(): Promise<void> {
|
||||
try {
|
||||
if (CloudService.hasInstance() && CloudService.instance.isAuthenticated()) {
|
||||
await this.syncCloudProfiles()
|
||||
}
|
||||
|
||||
if (CloudService.hasInstance()) {
|
||||
CloudService.instance.off("settings-updated", this.handleCloudSettingsUpdate)
|
||||
CloudService.instance.on("settings-updated", this.handleCloudSettingsUpdate)
|
||||
}
|
||||
} catch (error) {
|
||||
this.log(`Failed to initialize cloud profile sync when ready: ${error}`)
|
||||
}
|
||||
}
|
||||
|
||||
// Adds a new Task instance to clineStack, marking the start of a new task.
|
||||
// The instance is pushed to the top of the stack (LIFO order).
|
||||
// When the task is completed, the top instance is removed, reactivating the
|
||||
|
|
|
|||
|
|
@ -231,6 +231,15 @@ export async function activate(context: vscode.ExtensionContext) {
|
|||
// Add to subscriptions for proper cleanup on deactivate.
|
||||
context.subscriptions.push(cloudService)
|
||||
|
||||
// Trigger initial cloud profile sync now that CloudService is ready
|
||||
try {
|
||||
await provider.initializeCloudProfileSyncWhenReady()
|
||||
} catch (error) {
|
||||
outputChannel.appendLine(
|
||||
`[CloudService] Failed to initialize cloud profile sync: ${error instanceof Error ? error.message : String(error)}`,
|
||||
)
|
||||
}
|
||||
|
||||
// Finish initializing the provider.
|
||||
TelemetryService.instance.setProvider(provider)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue