Fix connection permission loss when updating server configurations#185
Closed
Fix connection permission loss when updating server configurations#185
Conversation
Copilot
AI
changed the title
[WIP] bug: When changing a connection in any way the teams and suers which previously had access to it lose that access. It is also very annoying that we have to add a connection for a given Team/User rather than adding the connection then being fit to chang...
Fix connection permission loss when updating server configurations
Sep 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When changing any connection property (password, host, port, etc.) from the main connections panel as a global admin, teams and users that previously had access to the connection lose that access. This forces administrators to manually re-assign connections to teams/users after every configuration change.
Root Cause
The issue occurs because
AdminModelusesServerConfig.equals()to determine if a cachedServerModelcan be reused. SinceServerConfig.equals()compares ALL properties (name, username, password, host, port, database, etc.), any property change causes the equality check to fail. This results in:AdminModelcreating a newServerModelinstanceServerModel(with team/user permissions) being discardedSolution
This PR fixes the issue by modifying how
AdminModelidentifies servers for caching purposes:ServerModel Changes
serverConfigfield fromfinalto allow updatesupdateServerConfig()method to update configuration while preserving the instanceAdminModel Changes
refresh()methods to use server name comparison instead of full object equalityServerModelexists with the same name, reuse it and update its configurationServerModelinstances and their associated permissionsImpact
Before Fix:
After Fix:
Testing
ServerModelBenefits
This is a surgical fix that resolves the permission issue while maintaining full backward compatibility.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.