-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Batch settings updates from the webview to the extension host #9165
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
Conversation
All issues resolved. Changes look good.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| try { | ||
| if (!CloudService.instance.isCloudAgent) { | ||
| cloudOrganizations = await CloudService.instance.getOrganizationMemberships() | ||
| const now = Date.now() | ||
|
|
||
| if ( | ||
| this.cloudOrganizationsCache !== null && | ||
| this.cloudOrganizationsCacheTimestamp !== null && | ||
| now - this.cloudOrganizationsCacheTimestamp < ClineProvider.CLOUD_ORGANIZATIONS_CACHE_DURATION_MS | ||
| ) { | ||
| cloudOrganizations = this.cloudOrganizationsCache! | ||
| } else { | ||
| cloudOrganizations = await CloudService.instance.getOrganizationMemberships() | ||
| this.cloudOrganizationsCache = cloudOrganizations | ||
| this.cloudOrganizationsCacheTimestamp = now | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The organization cache may store empty arrays from failed API calls for 5 minutes. When getOrganizationMemberships() returns an empty array due to an error (line 710 in WebAuthService.ts), this code caches it as valid data. Users won't see their actual organizations until the cache expires, even if the API becomes available again.
Consider checking if the result is a legitimate empty array (user has no orgs) vs an error case before caching, or add cache invalidation on auth state changes.
Fix it with Roo Code or mention @roomote and request a fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roomote Please fix this by throwing in getOrganizationMemberships instead of returning an empty array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixaroo
See task on Roo Cloud
Fixed the reported issue. All local checks passed.
Important
Batch updates settings using a single
updateSettingsmessage, refactoring components and tests for efficiency and consistency.updateSettingsmessage inwebviewMessageHandler.SettingsView,AutoApproveDropdown,CommandExecution,McpEnabledToggle, and other components to useupdateSettings.AutoApproveDropdownto useupdateSettingsfor toggling settings.CommandExecutionto update allowed/denied commands usingupdateSettings.McpEnabledToggleto useupdateSettingsfor toggling MCP.SettingsViewto batch update settings usingupdateSettings.CommandExecution.spec.tsxandSettingsView.spec.tsxto reflect changes in settings update mechanism.updateSettingsfor batch updates.This description was created by
for 697c12b. You can customize this summary. It will automatically update as commits are pushed.