Skip to content

Conversation

@cte
Copy link
Collaborator

@cte cte commented Nov 11, 2025

Important

Batch updates settings using a single updateSettings message, refactoring components and tests for efficiency and consistency.

  • Behavior:
    • Consolidates individual setting updates into a single updateSettings message in webviewMessageHandler.
    • Updates settings in SettingsView, AutoApproveDropdown, CommandExecution, McpEnabledToggle, and other components to use updateSettings.
  • Components:
    • Refactors AutoApproveDropdown to use updateSettings for toggling settings.
    • Refactors CommandExecution to update allowed/denied commands using updateSettings.
    • Updates McpEnabledToggle to use updateSettings for toggling MCP.
    • Modifies SettingsView to batch update settings using updateSettings.
  • Tests:
    • Updates tests in CommandExecution.spec.tsx and SettingsView.spec.tsx to reflect changes in settings update mechanism.
    • Ensures tests verify the use of updateSettings for batch updates.

This description was created by Ellipsis for 697c12b. You can customize this summary. It will automatically update as commits are pushed.

@cte cte requested review from jr and mrubens as code owners November 11, 2025 05:58
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. UI/UX UI/UX related or focused labels Nov 11, 2025
@roomote
Copy link
Contributor

roomote bot commented Nov 11, 2025

Rooviewer Clock   Follow along on Roo Cloud

All issues resolved. Changes look good.

  • Remove debug console.log in SettingsView.tsx line 328
  • Remove debug console.log in AutoApproveSettings.tsx line 118
  • Fix organization cache storing empty arrays from failed API calls
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 11, 2025
Comment on lines 1919 to +1937
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
}
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

@roomote roomote bot Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixaroo Clock   See task on Roo Cloud

Fixed the reported issue. All local checks passed.

View commit | Revert commit

@dosubot dosubot bot removed the size:XL This PR changes 500-999 lines, ignoring generated files. label Nov 11, 2025
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Nov 11, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Nov 12, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Nov 12, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 12, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Nov 12, 2025
@cte cte merged commit 62d8cc0 into main Nov 12, 2025
10 checks passed
@cte cte deleted the cte/batch-settings-updates branch November 12, 2025 20:29
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Nov 12, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Nov 12, 2025
mini2s added a commit to zgsm-ai/costrict that referenced this pull request Nov 13, 2025