-
Notifications
You must be signed in to change notification settings - Fork 607
Improve legacy configuration migration error handling and cleanup #470
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
- Change migration to always clean up legacy keys, even on partial failures - Upgrade migration messages from Debug to Warn/Info for better visibility - Add explicit warning when failures occur that manual configuration is needed - Remove early return on failures to ensure legacy keys are always deleted - Prevents migration retry loops when some clients fail to configure
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the legacy server configuration migration to always remove legacy keys, improves logging visibility and messaging on partial failures, and avoids retry loops when some clients fail to configure. Sequence diagram for updated legacy configuration migration behaviorsequenceDiagram
actor UnityEditor
participant LegacyServerSrcMigration
participant MCPServiceLocator
participant Client
participant EditorPrefs
participant McpLog
UnityEditor->>LegacyServerSrcMigration: RunMigrationIfNeeded()
LegacyServerSrcMigration->>MCPServiceLocator: Client.ConfigureAllDetectedClients()
MCPServiceLocator-->>LegacyServerSrcMigration: summary
alt summary.FailureCount > 0
LegacyServerSrcMigration->>McpLog: Warn([Legacy configuration migration finished with errors (...). details:])
alt summary.Messages != null
loop for each message in summary.Messages
LegacyServerSrcMigration->>McpLog: Warn([ {message}])
end
end
LegacyServerSrcMigration->>McpLog: Warn([Legacy keys will be removed to prevent migration loop. Please configure failing clients manually.])
else summary.FailureCount == 0
LegacyServerSrcMigration->>McpLog: Info([Legacy configuration migration complete (...)])
end
alt hasServerSrc
LegacyServerSrcMigration->>EditorPrefs: DeleteKey(ServerSrcKey)
LegacyServerSrcMigration->>McpLog: Info([ ✓ Removed legacy key: MCPForUnity.ServerSrc])
end
alt UseEmbedded
LegacyServerSrcMigration->>EditorPrefs: DeleteKey(UseEmbeddedKey)
LegacyServerSrcMigration->>McpLog: Info([ ✓ Removed legacy key: MCPForUnity.UseEmbeddedServer])
end
LegacyServerSrcMigration-->>UnityEditor: migration completed (no retry loop)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Rate limit exceeded@msanatan has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 44 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Hey - I've left some high level feedback:
- Now that warnings are always emitted on any failure, consider whether using
McpLog.Warnfor every individual message is too noisy for typical users and whether some messages should stay atInfowith a single higher-level warning summarizing the failures. - The new condition
if (summary.FailureCount > 0)changes behavior from also treatingSuccessCount == 0as a failure; if there are no detected clients (0 success, 0 failure), confirm that this is intended and that we don’t need a special-case log or handling for that scenario.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Now that warnings are always emitted on any failure, consider whether using `McpLog.Warn` for every individual message is too noisy for typical users and whether some messages should stay at `Info` with a single higher-level warning summarizing the failures.
- The new condition `if (summary.FailureCount > 0)` changes behavior from also treating `SuccessCount == 0` as a failure; if there are no detected clients (0 success, 0 failure), confirm that this is intended and that we don’t need a special-case log or handling for that scenario.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Partly addresses #464.
Summary by Sourcery
Improve handling of legacy configuration migration outcomes while ensuring legacy keys are always cleaned up.
Enhancements: