Skip to content

Conversation

kantord
Copy link
Member

@kantord kantord commented Oct 9, 2025

context https://stacklok.slack.com/archives/C091GRYAG49/p1760033135113959?thread_ts=1760003349.102839&cid=C091GRYAG49

Make optimistic updates group-aware (use-mutation-restart-server.ts, graceful-exit.ts); (Optimistic updates were hardcoded to group: 'default)

@kantord kantord changed the title Weird behavior groups fix: weird behavior with groups when restarting server Oct 10, 2025
@kantord kantord marked this pull request as ready for review October 13, 2025 10:19
@Copilot Copilot AI review requested due to automatic review settings October 13, 2025 10:19
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where group-aware optimistic updates were hardcoded to use the 'default' group instead of respecting the actual group context. The fix ensures that when restarting servers, the optimistic UI updates correctly target the appropriate group's query cache.

  • Updates query cache operations to be group-aware instead of hardcoded to 'default'
  • Modifies restart server mutations to accept and use group parameters
  • Refactors optimistic update logic to handle multiple query cache entries per group

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
renderer/src/routes/group.$groupName.tsx Conditionally uses group name based on sidebar visibility
renderer/src/features/mcp-servers/hooks/use-mutation-restart-server.ts Major refactor to support group-aware optimistic updates and cache management
renderer/src/features/mcp-servers/hooks/__tests__/use-mutation-restart-server.test.ts Removes unused test data and imports
renderer/src/features/mcp-servers/components/card-mcp-server/index.tsx Passes group parameter to restart server mutation
main/src/graceful-exit.ts Changes return type from string array to CoreWorkload array

Copy link
Collaborator

@samuv samuv left a comment

Choose a reason for hiding this comment

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

:shipit:

@kantord kantord merged commit 182b510 into main Oct 13, 2025
13 checks passed
@kantord kantord deleted the weird-behavior-groups branch October 13, 2025 17:07
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.

2 participants